[Design of JBossXB] - Re: @XmlType.propOrder required even if schema does not defi
by thomas.diesler@jboss.com
| <xsd:complexType name="TregistrationListener">
| <xsd:annotation>
| <xsd:documentation>
| <![CDATA[
| A registration listener definition. The target registration listener
| can be either a <ref> to a <bean> or <service> component, or an inline
| <bean> or <service> component definition. The registration-method and
| unregistration-method attributes define the methods that will be called
| for the respective events.
|
| For the very common case of using a <ref> to a listener component, the
| ref attribute may also be used as a shortcut.
| ]]>
| </xsd:documentation>
| </xsd:annotation>
| <xsd:group ref="targetComponent" />
| <xsd:attribute name="ref" type="Tidref" use="optional" />
| <!-- ### why are there both required? -->
| <xsd:attribute name="registration-method" type="Tmethod" use="required" />
| <xsd:attribute name="unregistration-method" type="Tmethod" use="required" />
| </xsd:complexType>
|
| <xsd:group name="targetComponent">
| <xsd:annotation>
| <xsd:documentation>
| <![CDATA[
| A targetcomponent is one that can be a target for a
| listener, registration-listener, or type-converter element.
| This is used in contexts where the requirement is a single
| provided object that will implement a particular interface.
| The provided object is obtained either from a <ref> element
| or inline (<bean> or <reference>).
| ]]>
| </xsd:documentation>
| </xsd:annotation>
| <xsd:choice>
| <xsd:element name="bean" type="Tbean" />
| <xsd:element name="reference" type="Treference" />
| <xsd:element name="ref" type="Tref" />
| <xsd:any namespace="##other" processContents="strict" minOccurs="0" maxOccurs="unbounded" />
| </xsd:choice>
| </xsd:group>
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241722#4241722
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241722
16 years, 6 months
[Design the new POJO MicroContainer] - Re: Parallel deployments
by kabir.khan@jboss.com
"smarlow(a)redhat.com" wrote :
| Could you share your AS changes (if you don't check them in)? I would also like to experiment with using parallel deployment in AS.
| -Scott
I currently have a bean for local testing in the server/ module:
| package org.jboss.executor;
|
| import java.util.concurrent.Executor;
|
| import org.jboss.dependency.plugins.AbstractController;
| import org.jboss.dependency.spi.ControllerContext;
|
| /**
| * Bean used to install an Executor in the controller
| *
| * @author <a href="kabir.khan(a)jboss.com">Kabir Khan</a>
| * @version $Revision: 1.1 $
| */
| public class ControllerExecutorInstaller
| {
| ControllerContext context;
|
| Executor executor;
|
| public ControllerContext getContext()
| {
| return context;
| }
|
| public void setContext(ControllerContext context)
| {
| this.context = context;
| }
|
| public Executor getExecutor()
| {
| return executor;
| }
|
| public void setExecutor(Executor executor)
| {
| this.executor = executor;
| }
|
| public void start()
| {
| ((AbstractController)context.getController()).setExecutor(executor);
| }
|
| public void stop()
| {
| ((AbstractController)context.getController()).setExecutor(null);
| }
| }
|
configured via conf/bootstrap/asynch.xml (added to bootstrap.xml)
| <?xml version="1.0" encoding="UTF-8"?>
|
| <!--
| The Executor used by the controller to do asynchronous deployments
| -->
| <deployment xmlns="urn:jboss:bean-deployer:2.0">
| <classloader><inject bean="asynch-classloader:0.0.0"/></classloader>
|
| <classloader name="asynch-classloader" xmlns="urn:jboss:classloader:1.0" export-all="NON_EMPTY" import-all="true">
| <root>${jboss.common.lib.url}jboss.jar</root>
| </classloader>
|
| <bean name="ControllerExecutorInstaller" class="org.jboss.executor.ControllerExecutorInstaller">
| <property name="context"><inject fromContext="context"/></property>
| <property name="executor"><inject name="ControllerExecutor"/></property>
| </bean>
|
| <bean name="ControllerExecutor" class="java.util.concurrent.Executor">
| <constructor factoryClass="java.util.concurrent.Executors" factoryMethod="newFixedThreadPool">
| <parameter>10</parameter>
| </constructor>
| </bean>
| </deployment>
|
However, it is not working properly in AS yet, I get the following errors for the asynchronous beans
| 13:13:29,126 ERROR [AbstractKernelController] Error installing to Create: name=CacheManager state=Create mode=Asynchronous requiredState=Installed
| java.lang.Exception: Error calling callback JMXCreateDestroyAdvice for target context CacheManager
| at org.jboss.dependency.plugins.AbstractLifecycleCallbackItem.install(AbstractLifecycleCallbackItem.java:91)
| at org.jboss.dependency.plugins.AbstractController.handleLifecycleCallbacks(AbstractController.java:1687)
| at org.jboss.dependency.plugins.AbstractController.handleInstallLifecycleCallbacks(AbstractController.java:1652)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:961)
| at org.jboss.dependency.plugins.AbstractController.executeOrIncrementStateDirectly(AbstractController.java:1187)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1105)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1002)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:792)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:557)
| at org.jboss.system.ServiceController.doInstall(ServiceController.java:653)
| at org.jboss.system.ServiceController.register(ServiceController.java:356)
| at org.jboss.system.microcontainer.jmx.ServiceControllerRegistrationLifecycleCallback.install(ServiceControllerRegistrationLifecycleCallback.java:104)
| at sun.reflect.GeneratedMethodAccessor243.invoke(Unknown Source)
| 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:59)
| at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
| at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
| at org.jboss.beans.info.plugins.AbstractBeanInfo.invoke(AbstractBeanInfo.java:300)
| at org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext.invoke(AbstractKernelControllerContext.java:291)
| at org.jboss.dependency.plugins.AbstractLifecycleCallbackItem.install(AbstractLifecycleCallbackItem.java:87)
| at org.jboss.dependency.plugins.AbstractController.handleLifecycleCallbacks(AbstractController.java:1687)
| at org.jboss.dependency.plugins.AbstractController.handleInstallLifecycleCallbacks(AbstractController.java:1652)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:961)
| at org.jboss.dependency.plugins.AbstractController$InstallControllerContextTask.installMyContext(AbstractController.java:2240)
| at org.jboss.dependency.plugins.AbstractController$InstallControllerContextTask.run(AbstractController.java:2185)
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
| at java.lang.Thread.run(Thread.java:613)
| Caused by: java.lang.IllegalStateException: jboss.cache:service=CacheManager is already installed.
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:733)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:557)
| at org.jboss.system.ServiceController.doInstall(ServiceController.java:653)
| at org.jboss.system.ServiceController.register(ServiceController.java:356)
| at org.jboss.system.ServiceController.register(ServiceController.java:325)
| at org.jboss.system.ServiceController.register(ServiceController.java:312)
| at org.jboss.system.ServiceController.create(ServiceController.java:387)
| at org.jboss.system.ServiceController.create(ServiceController.java:370)
| at org.jboss.system.microcontainer.jmx.ServiceControllerCreateDestroyLifecycleCallback.install(ServiceControllerCreateDestroyLifecycleCallback.java:44)
| at sun.reflect.GeneratedMethodAccessor251.invoke(Unknown Source)
| 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:59)
| at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:150)
| at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66)
| at org.jboss.beans.info.plugins.AbstractBeanInfo.invoke(AbstractBeanInfo.java:300)
| at org.jboss.kernel.plugins.dependency.AbstractKernelControllerContext.invoke(AbstractKernelControllerContext.java:291)
| at org.jboss.dependency.plugins.AbstractLifecycleCallbackItem.install(AbstractLifecycleCallbackItem.java:87)
| ... 28 more
|
This error does not happen if I remove 'mode="Asynchronous"' from the beans. I'll add some more tests to core kernel to see if lifecycle callbacks are handled properly for asynchronous beans.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241706#4241706
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241706
16 years, 6 months
[Design the new POJO MicroContainer] - Re: Parallel deployments
by alesj
"kabir.khan(a)jboss.com" wrote :
| I could add the setExecutor() method to the Controller interface, but maybe it belongs better in an AsynchController interface (similarly to what was done for GraphController)?
No and no. :-)
I don't we should expose Executor on Controller, as this is impl detail.
The Controller should only expose "state machine" API.
Afaic AsynchController doesn't have any proper value,
to only exist to expose setter/getter doesn't make sense.
I guess what you could do is to create proper KernelConfig/Initializer,
which knows how to supply proper Executor to new Controller instance.
Or, I actually don't mind if you do a cast to AbstractContorller, as long as you do the check before.
I'll think about this some more ... if there is any nicer way to handle this.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241701#4241701
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241701
16 years, 6 months
[Design of JBossXB] - Re: JBossXB does not assign schema defined attribute default
by alesj
"alex.loubyansky(a)jboss.com" wrote :
| The issue is actually with jboss-reflect. Apparently, propertyInfo.getUnderlyingAnnotation(annotationType) doesn't work for 'is'-methods (i.e. it returns null even if the method is annotated).
Nope, not a Reflect issue.
It's by the spec, that only primitive boolean' getter should be isX,
where as in this case - with Boolean - it should be getX.
| public class AbstractBeanInfoFactory implements BeanInfoFactory
| {
| /** The cache */
| protected Map<ClassLoader, Map<ClassInfo, Map<BeanAccessMode, BeanInfo>>> cache = new WeakHashMap<ClassLoader, Map<ClassInfo, Map<BeanAccessMode, BeanInfo>>>();
|
| protected static boolean isGetter(MethodInfo minfo)
| {
| String name = minfo.getName();
| TypeInfo returnType = minfo.getReturnType();
| TypeInfo[] parameters = minfo.getParameterTypes();
| if ((name.length() > 3 && name.startsWith("get")) || (name.length() > 2 && name.startsWith("is")))
| {
| // isBoolean() is not a getter for java.lang.Boolean
| if (name.startsWith("is") && PrimitiveInfo.BOOLEAN.equals(returnType) == false)
| return false;
| if (parameters.length == 0 && PrimitiveInfo.VOID.equals(returnType) == false)
| return true;
| }
| return false;
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4241699#4241699
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4241699
16 years, 6 months