[JBoss JIRA] Created: (JBMICROCONT-165) Add support for Install items
by Adrian Brock (JIRA)
Add support for Install items
-----------------------------
Key: JBMICROCONT-165
URL: http://jira.jboss.com/jira/browse/JBMICROCONT-165
Project: JBoss MicroContainer
Issue Type: Task
Components: Dependency
Reporter: Adrian Brock
Assigned To: Ales Justin
We already support contextual dependency injection
(injected based on class)
@Inject
public void setSomething(X x);
and installation into "repositories"
<bean name="Queue1">
<install bean="JMSBroker" method="addQueue"/>
</bean>
There should be additional support for more dynamic injection/installation.
In annotations the three new features are:
1) The injection is dynamic
- the service will start even if the dependency is not satisifed
- the service might get the injection later when it is available
@Inject(optional=true)
public void setSomething(X x);
2) Installation of "services" by type
- Inject all implementors of a particular class
- Keep reinjecting as implementors come and go
- The cardinality specifies the minimum number
that must exist for the service to start
@Install(cardinality=0)
public void setSomethings(Collection<X> x)
3) Like (2) but with add/remove methods
@Install(cardinality=0)
public void addSomething(X x)
@Uninstall
public void removeSomething(X x)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years
[JBoss JIRA] Created: (JBMICROCONT-176) Injection of KernelController fails in bootstrap xml
by Scott M Stark (JIRA)
Injection of KernelController fails in bootstrap xml
----------------------------------------------------
Key: JBMICROCONT-176
URL: http://jira.jboss.com/jira/browse/JBMICROCONT-176
Project: JBoss MicroContainer
Issue Type: Bug
Affects Versions: JBossMC_2_0_0 Beta3
Reporter: Scott M Stark
If I attempt to the KernelController into the HDScanner defined in the conf/bootstrap-beans.xml using:
<!-- Hotdeployment of applications -->
<bean name="HDScanner"
class="org.jboss.system.server.profileservice.hotdeploy.HDScanner">
<property name="mainDeployer"><inject bean="MainDeployer"/></property>
<property name="controller"><inject bean="jboss.kernel:service=Kernel" property="controller"/></property>
<property name="profileService"><inject bean="ProfileService"/></property>
<property name="scanPeriod">5000</property>
<property name="scanThreadName">HDScanner</property>
</bean>
this fails with:
10:10:51,406 ERROR [AbstractKernelController] Error installing to Configured: name=HDScanner state=Instantiated
java.lang.IllegalArgumentException: Wrong arguments. setController for target org.jboss.system.server.profileservice.hotdeploy.HDScanner@568bf3ec expected=[org.jboss.kernel.spi.dependency.KernelController] actual=[org.jboss.kernel.Kernel]
at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:224)
at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:59)
at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:108)
at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:103)
at org.jboss.kernel.plugins.dependency.ConfigureAction.setAttributes(ConfigureAction.java:137)
at org.jboss.kernel.plugins.dependency.ConfigureAction.installActionInternal(ConfigureAction.java:60)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:197)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.install(KernelControllerContextAction.java:136)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:233)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:724)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:445)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:555)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:489)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:289)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:192)
at org.jboss.system.ServiceController.doInstall(ServiceController.java:638)
at org.jboss.system.ServiceController.register(ServiceController.java:344)
at org.jboss.system.ServiceController.start(ServiceController.java:415) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:194)
at org.jboss.aop.deployment.AspectManagerService.postRegister(AspectManagerService.java:634)
at org.jboss.mx.server.AbstractMBeanInvoker.invokePostRegister(AbstractMBeanInvoker.java:974)
at org.jboss.mx.server.AbstractMBeanInvoker.postRegister(AbstractMBeanInvoker.java:681)
at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:336)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:138)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:140)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:90)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668) at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1431) at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1426)
at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376)
at org.jboss.aop.deployers.AspectManagerJMXRegistrar.start(AspectManagerJMXRegistrar.java:57)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:55)
at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:108)
at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:103)
at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:145)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:197)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.install(KernelControllerContextAction.java:136)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:233)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:724)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:445)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:555)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:489)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:289)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:192)
at org.jboss.kernel.plugins.dependency.AbstractKernelController.install(AbstractKernelController.java:84)
at org.jboss.system.server.profileservice.ProfileServiceBootstrap.bootstrap(ProfileServiceBootstrap.java:232)
at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:89)
at org.jboss.system.server.profileservice.ServerImpl.doStart(ServerImpl.java:403)
at org.jboss.system.server.profileservice.ServerImpl.start(ServerImpl.java:342)
at org.jboss.Main.boot(Main.java:210)
at org.jboss.Main$1.run(Main.java:522)
at java.lang.Thread.run(Thread.java:595)
Going through the code, the failure occurs because the AbstractDependencyValueMetaData.getValue requires a property != null && lookup instanceof AttributeDispatchContext. The lookup in this case is a KernelRegistryEntry, so the property value is not retrieved and instead the bean is used as the value.
public Object getValue(TypeInfo info, ClassLoader cl) throws Throwable
{
ControllerState state = dependentState;
if (state == null)
state = ControllerState.INSTALLED;
Controller controller = context.getController();
ControllerContext lookup = controller.getContext(value, state);
if (lookup == null)
throw new Error("Should not be here - dependency failed! " + this);
Object result = lookup.getTarget();
if (property != null && lookup instanceof AttributeDispatchContext)
{
AttributeDispatchContext adc = (AttributeDispatchContext) lookup;
result = adc.get(property);
}
return info != null ? info.convertValue(result) : result;
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years
[JBoss JIRA] Created: (JBCACHE-1041) Tutorial - GUI/beanshell block if node modified within transaction and
by Galder Zamarreno (JIRA)
Tutorial - GUI/beanshell block if
node modified within transaction and node status queried via GUI
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Precedence: bulk
Tutorial - GUI/beanshell block if node modified within transaction and
Tutorial - GUI/beanshell block if node modified within transaction and node status queried via GUI
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Key: JBCACHE-1041
URL: http://jira.jboss.com/jira/browse/JBCACHE-1041
Project: JBoss Cache
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 2.0.0.CR1
Reporter: Galder Zamarreno
Assigned To: Galder Zamarreno
Priority: Minor
Fix For: 2.0.0.CR2
Instructions:
- add a node to the cache
- start a transaction
- do a put on that node
- clicking on the node via the GUI to check that the node has not been
updated blocks both the GUI and the beanshell. This is due to not being able to
acquire the read lock on the node to show it.
- Also, once the exception is thrown, the GUI/beanshell stops which shouldn't.
Solution:
- Updates on the GUI should be handled in a different thread so that it does
not block the shell? While the shell is blocked, the current transaction cannot be
committed, leaving the user no option.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
19 years