Search in sources :

Example 6 with ResourceEnvRef$JAXB.writeResourceEnvRef

use of org.apache.openejb.jee.ResourceEnvRef$JAXB.writeResourceEnvRef in project tomee by apache.

the class LegacyProcessor method process.

public static void process(final Class<?> clazz, final EnterpriseBean bean) {
    if (bean instanceof SessionBean) {
        final SessionBean sessionBean = (SessionBean) bean;
        if (sessionBean.getSessionType() == STATEFUL && SessionSynchronization.class.isAssignableFrom(clazz)) {
            try {
                sessionBean.getAfterBegin().add(new LifecycleCallback(clazz.getMethod("afterBegin")));
                sessionBean.getBeforeCompletion().add(new LifecycleCallback(clazz.getMethod("beforeCompletion")));
                sessionBean.getAfterCompletion().add(new LifecycleCallback(clazz.getMethod("afterCompletion", boolean.class)));
            } catch (final NoSuchMethodException e) {
            //Ignore, should never happen
            }
        }
        if (javax.ejb.SessionBean.class.isAssignableFrom(clazz)) {
            final ResourceEnvRef ref = new ResourceEnvRef("javax.ejb.SessionBean/sessionContext", SessionContext.class);
            final InjectionTarget target = new InjectionTarget();
            target.setInjectionTargetClass(clazz);
            target.setInjectionTargetName("sessionContext");
            ref.getInjectionTarget().add(target);
            sessionBean.getResourceEnvRef().add(ref);
        }
    }
    if (bean instanceof MessageDrivenBean) {
        final MessageDrivenBean messageDrivenBean = (MessageDrivenBean) bean;
        if (javax.ejb.MessageDrivenBean.class.isAssignableFrom(clazz)) {
            final ResourceEnvRef ref = new ResourceEnvRef("javax.ejb.MessageDrivenBean/messageDrivenContext", MessageDrivenContext.class);
            final InjectionTarget target = new InjectionTarget();
            target.setInjectionTargetClass(clazz);
            target.setInjectionTargetName("messageDrivenContext");
            ref.getInjectionTarget().add(target);
            messageDrivenBean.getResourceEnvRef().add(ref);
        }
    }
}
Also used : SessionSynchronization(javax.ejb.SessionSynchronization) MessageDrivenBean(org.apache.openejb.jee.MessageDrivenBean) InjectionTarget(org.apache.openejb.jee.InjectionTarget) LifecycleCallback(org.apache.openejb.jee.LifecycleCallback) SessionBean(org.apache.openejb.jee.SessionBean) ResourceEnvRef(org.apache.openejb.jee.ResourceEnvRef)

Example 7 with ResourceEnvRef$JAXB.writeResourceEnvRef

use of org.apache.openejb.jee.ResourceEnvRef$JAXB.writeResourceEnvRef in project tomee by apache.

the class BuiltInEnvironmentEntries method add.

private void add(final JndiConsumer jndi, final DeploymentModule module, final DeploymentModule app, final boolean defaults) {
    // Standard names
    add(jndi.getEnvEntryMap(), new EnvEntry().name("java:module/ModuleName").value(module.getModuleId()).type(String.class));
    add(jndi.getEnvEntryMap(), new EnvEntry().name("java:app/AppName").value(app.getModuleId()).type(String.class));
    // Standard References to built-in objects
    add(jndi.getResourceEnvRefMap(), new ResourceEnvRef().name("java:comp/BeanManager").type(BeanManager.class));
    add(jndi.getResourceEnvRefMap(), new ResourceEnvRef().name("java:comp/Validator").type(Validator.class));
    add(jndi.getResourceEnvRefMap(), new ResourceEnvRef().name("java:comp/ValidatorFactory").type(ValidatorFactory.class));
    add(jndi.getResourceEnvRefMap(), new ResourceEnvRef().name("java:comp/TransactionManager").type(TransactionManager.class));
    add(jndi.getResourceEnvRefMap(), new ResourceEnvRef().name("java:comp/TransactionSynchronizationRegistry").type(TransactionSynchronizationRegistry.class));
    if (defaults) {
        add(jndi.getResourceEnvRefMap(), new ResourceEnvRef().name("java:comp/DefaultManagedExecutorService").type(ManagedExecutorService.class));
        add(jndi.getResourceEnvRefMap(), new ResourceEnvRef().name("java:comp/DefaultManagedScheduledExecutorService").type(ManagedScheduledExecutorService.class));
        add(jndi.getResourceEnvRefMap(), new ResourceEnvRef().name("java:comp/DefaultManagedThreadFactory").type(ManagedThreadFactory.class));
        try {
            final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
            contextClassLoader.loadClass("org.apache.activemq.ActiveMQSslConnectionFactory");
            final ResourceEnvRef ref = new ResourceEnvRef().name("java:comp/DefaultJMSConnectionFactory").type(contextClassLoader.loadClass("javax.jms.ConnectionFactory"));
            add(jndi.getResourceEnvRefMap(), ref);
        } catch (final ClassNotFoundException | NoClassDefFoundError notThere) {
        // no-op
        }
    }
    // OpenEJB specific feature
    add(jndi.getEnvEntryMap(), new EnvEntry().name("java:comp/ComponentName").value(jndi.getJndiConsumerName()).type(String.class));
}
Also used : ValidatorFactory(javax.validation.ValidatorFactory) ManagedThreadFactory(javax.enterprise.concurrent.ManagedThreadFactory) ManagedExecutorService(javax.enterprise.concurrent.ManagedExecutorService) TransactionManager(javax.transaction.TransactionManager) TransactionSynchronizationRegistry(javax.transaction.TransactionSynchronizationRegistry) BeanManager(javax.enterprise.inject.spi.BeanManager) ResourceEnvRef(org.apache.openejb.jee.ResourceEnvRef) Validator(javax.validation.Validator) ManagedScheduledExecutorService(javax.enterprise.concurrent.ManagedScheduledExecutorService) EnvEntry(org.apache.openejb.jee.EnvEntry)

Example 8 with ResourceEnvRef$JAXB.writeResourceEnvRef

use of org.apache.openejb.jee.ResourceEnvRef$JAXB.writeResourceEnvRef in project tomee by apache.

the class ApplyOpenejbJar method deploy.

public AppModule deploy(final AppModule appModule) throws OpenEJBException {
    for (final EjbModule ejbModule : appModule.getEjbModules()) {
        final Map<String, EjbDeployment> ejbDeployments = ejbModule.getOpenejbJar().getDeploymentsByEjbName();
        for (final EnterpriseBean enterpriseBean : ejbModule.getEjbJar().getEnterpriseBeans()) {
            // Get the OpenEJB deployment from openejb-jar.xml
            final EjbDeployment ejbDeployment = ejbDeployments.get(enterpriseBean.getEjbName());
            enterpriseBean.setId(ejbDeployment.getDeploymentId());
            for (final ResourceRef ref : enterpriseBean.getResourceRef()) {
                final ResourceLink resourceLink = ejbDeployment.getResourceLink(ref.getName());
                if (resourceLink != null && resourceLink.getResId() != null) /* don't overwrite with null */
                {
                    ref.setMappedName(resourceLink.getResId());
                }
            }
            for (final ResourceEnvRef ref : enterpriseBean.getResourceEnvRef()) {
                final ResourceLink resourceLink = ejbDeployment.getResourceLink(ref.getName());
                if (resourceLink != null && resourceLink.getResId() != null) /* don't overwrite with null */
                {
                    ref.setMappedName(resourceLink.getResId());
                }
            }
            for (final MessageDestinationRef ref : enterpriseBean.getMessageDestinationRef()) {
                final ResourceLink resourceLink = ejbDeployment.getResourceLink(ref.getName());
                if (resourceLink != null && resourceLink.getResId() != null) /* don't overwrite with null */
                {
                    ref.setMappedName(resourceLink.getResId());
                }
            }
            for (final EjbRef ref : enterpriseBean.getEjbRef()) {
                final EjbLink ejbLink = ejbDeployment.getEjbLink(ref.getName());
                if (ejbLink != null && ejbLink.getDeployentId() != null) /* don't overwrite with null */
                {
                    ref.setMappedName(ejbLink.getDeployentId());
                }
            }
            for (final EjbLocalRef ref : enterpriseBean.getEjbLocalRef()) {
                final EjbLink ejbLink = ejbDeployment.getEjbLink(ref.getName());
                if (ejbLink != null && ejbLink.getDeployentId() != null) /* don't overwrite with null */
                {
                    ref.setMappedName(ejbLink.getDeployentId());
                }
            }
        }
    }
    return appModule;
}
Also used : EjbLocalRef(org.apache.openejb.jee.EjbLocalRef) MessageDestinationRef(org.apache.openejb.jee.MessageDestinationRef) EnterpriseBean(org.apache.openejb.jee.EnterpriseBean) ResourceLink(org.apache.openejb.jee.oejb3.ResourceLink) EjbRef(org.apache.openejb.jee.EjbRef) EjbDeployment(org.apache.openejb.jee.oejb3.EjbDeployment) ResourceRef(org.apache.openejb.jee.ResourceRef) ResourceEnvRef(org.apache.openejb.jee.ResourceEnvRef) EjbLink(org.apache.openejb.jee.oejb3.EjbLink)

Example 9 with ResourceEnvRef$JAXB.writeResourceEnvRef

use of org.apache.openejb.jee.ResourceEnvRef$JAXB.writeResourceEnvRef in project tomee by apache.

the class InjectionTest method setUp.

protected void setUp() throws Exception {
    super.setUp();
    System.setProperty(javax.naming.Context.INITIAL_CONTEXT_FACTORY, LocalInitialContextFactory.class.getName());
    final ConfigurationFactory config = new ConfigurationFactory();
    final Assembler assembler = new Assembler();
    assembler.createProxyFactory(config.configureService(ProxyFactoryInfo.class));
    assembler.createTransactionManager(config.configureService(TransactionServiceInfo.class));
    assembler.createSecurityService(config.configureService(SecurityServiceInfo.class));
    // containers
    final StatelessSessionContainerInfo statelessContainerInfo = config.configureService(StatelessSessionContainerInfo.class);
    statelessContainerInfo.properties.setProperty("TimeOut", "10");
    statelessContainerInfo.properties.setProperty("MaxSize", "0");
    statelessContainerInfo.properties.setProperty("StrictPooling", "false");
    assembler.createContainer(statelessContainerInfo);
    // Setup the descriptor information
    final StatelessBean bean = new StatelessBean(WidgetBean.class);
    bean.addBusinessLocal(Widget.class.getName());
    bean.addBusinessRemote(RemoteWidget.class.getName());
    final EjbJar ejbJar = new EjbJar();
    ejbJar.addEnterpriseBean(bean);
    bean.getEnvEntry().add(new EnvEntry(name("myString"), "java.lang.String", "2"));
    bean.getEnvEntry().add(new EnvEntry(name("myDouble"), "java.lang.Double", "3.0"));
    bean.getEnvEntry().add(new EnvEntry(name("myLong"), "java.lang.Long", "4"));
    bean.getEnvEntry().add(new EnvEntry(name("myFloat"), "java.lang.Float", "5"));
    bean.getEnvEntry().add(new EnvEntry(name("myInteger"), "java.lang.Integer", "6"));
    bean.getEnvEntry().add(new EnvEntry(name("myShort"), "java.lang.Short", "7"));
    bean.getEnvEntry().add(new EnvEntry(name("myBoolean"), "java.lang.Boolean", "false"));
    bean.getEnvEntry().add(new EnvEntry(name("myByte"), "java.lang.Byte", "8"));
    bean.getEnvEntry().add(new EnvEntry(name("myCharacter"), "java.lang.Character", "9"));
    bean.getEnvEntry().add(new EnvEntry(name("myClass"), "java.lang.Class", Widget.class.getName()));
    bean.getEnvEntry().add(new EnvEntry(name("myTimeUnit"), TimeUnit.class.getName(), "HOURS"));
    final EnvEntry entry = new EnvEntry("injectedBoolean", (String) null, "true");
    entry.getInjectionTarget().add((new InjectionTarget(WidgetBean.class.getName(), "injectedBoolean")));
    bean.getEnvEntry().add(entry);
    final ResourceEnvRef resourceEnvRef = new ResourceEnvRef("injectedContext", (String) null);
    resourceEnvRef.getInjectionTarget().add((new InjectionTarget(WidgetBean.class.getName(), "injectedContext")));
    bean.getResourceEnvRef().add(resourceEnvRef);
    assembler.createApplication(config.configureApplication(ejbJar));
}
Also used : StatelessSessionContainerInfo(org.apache.openejb.assembler.classic.StatelessSessionContainerInfo) LocalInitialContextFactory(org.apache.openejb.core.LocalInitialContextFactory) ProxyFactoryInfo(org.apache.openejb.assembler.classic.ProxyFactoryInfo) TransactionServiceInfo(org.apache.openejb.assembler.classic.TransactionServiceInfo) StatelessBean(org.apache.openejb.jee.StatelessBean) InjectionTarget(org.apache.openejb.jee.InjectionTarget) Assembler(org.apache.openejb.assembler.classic.Assembler) SecurityServiceInfo(org.apache.openejb.assembler.classic.SecurityServiceInfo) ResourceEnvRef(org.apache.openejb.jee.ResourceEnvRef) EjbJar(org.apache.openejb.jee.EjbJar) EnvEntry(org.apache.openejb.jee.EnvEntry)

Example 10 with ResourceEnvRef$JAXB.writeResourceEnvRef

use of org.apache.openejb.jee.ResourceEnvRef$JAXB.writeResourceEnvRef in project tomee by apache.

the class Interceptor$JAXB method _write.

public static final void _write(final XoXMLStreamWriter writer, final Interceptor interceptor, RuntimeContext context) throws Exception {
    if (interceptor == null) {
        writer.writeXsiNil();
        return;
    }
    if (context == null) {
        context = new RuntimeContext();
    }
    final String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
    if (Interceptor.class != interceptor.getClass()) {
        context.unexpectedSubclass(writer, interceptor, Interceptor.class);
        return;
    }
    context.beforeMarshal(interceptor, org.metatype.sxc.jaxb.LifecycleCallback.NONE);
    // ATTRIBUTE: id
    final String idRaw = interceptor.id;
    if (idRaw != null) {
        String id = null;
        try {
            id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
        } catch (final Exception e) {
            context.xmlAdapterError(interceptor, "id", CollapsedStringAdapter.class, String.class, String.class, e);
        }
        writer.writeAttribute("", "", "id", id);
    }
    // ELEMENT: descriptions
    Text[] descriptions = null;
    try {
        descriptions = interceptor.getDescriptions();
    } catch (final Exception e) {
        context.getterError(interceptor, "descriptions", Interceptor.class, "getDescriptions", e);
    }
    if (descriptions != null) {
        for (final Text descriptionsItem : descriptions) {
            if (descriptionsItem != null) {
                writer.writeStartElement(prefix, "description", "http://java.sun.com/xml/ns/javaee");
                writeText(writer, descriptionsItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "descriptions");
            }
        }
    }
    // ELEMENT: interceptorClass
    final String interceptorClassRaw = interceptor.interceptorClass;
    String interceptorClass = null;
    try {
        interceptorClass = Adapters.collapsedStringAdapterAdapter.marshal(interceptorClassRaw);
    } catch (final Exception e) {
        context.xmlAdapterError(interceptor, "interceptorClass", CollapsedStringAdapter.class, String.class, String.class, e);
    }
    if (interceptorClass != null) {
        writer.writeStartElement(prefix, "interceptor-class", "http://java.sun.com/xml/ns/javaee");
        writer.writeCharacters(interceptorClass);
        writer.writeEndElement();
    } else {
        context.unexpectedNullValue(interceptor, "interceptorClass");
    }
    // ELEMENT: aroundInvoke
    final List<AroundInvoke> aroundInvoke = interceptor.aroundInvoke;
    if (aroundInvoke != null) {
        for (final AroundInvoke aroundInvokeItem : aroundInvoke) {
            if (aroundInvokeItem != null) {
                writer.writeStartElement(prefix, "around-invoke", "http://java.sun.com/xml/ns/javaee");
                writeAroundInvoke(writer, aroundInvokeItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "aroundInvoke");
            }
        }
    }
    // ELEMENT: aroundTimeout
    final List<AroundTimeout> aroundTimeout = interceptor.aroundTimeout;
    if (aroundTimeout != null) {
        for (final AroundTimeout aroundTimeoutItem : aroundTimeout) {
            if (aroundTimeoutItem != null) {
                writer.writeStartElement(prefix, "around-timeout", "http://java.sun.com/xml/ns/javaee");
                writeAroundTimeout(writer, aroundTimeoutItem, context);
                writer.writeEndElement();
            }
        }
    }
    // ELEMENT: envEntry
    final KeyedCollection<String, EnvEntry> envEntry = interceptor.envEntry;
    if (envEntry != null) {
        for (final EnvEntry envEntryItem : envEntry) {
            if (envEntryItem != null) {
                writer.writeStartElement(prefix, "env-entry", "http://java.sun.com/xml/ns/javaee");
                writeEnvEntry(writer, envEntryItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "envEntry");
            }
        }
    }
    // ELEMENT: ejbRef
    final KeyedCollection<String, EjbRef> ejbRef = interceptor.ejbRef;
    if (ejbRef != null) {
        for (final EjbRef ejbRefItem : ejbRef) {
            if (ejbRefItem != null) {
                writer.writeStartElement(prefix, "ejb-ref", "http://java.sun.com/xml/ns/javaee");
                writeEjbRef(writer, ejbRefItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "ejbRef");
            }
        }
    }
    // ELEMENT: ejbLocalRef
    final KeyedCollection<String, EjbLocalRef> ejbLocalRef = interceptor.ejbLocalRef;
    if (ejbLocalRef != null) {
        for (final EjbLocalRef ejbLocalRefItem : ejbLocalRef) {
            if (ejbLocalRefItem != null) {
                writer.writeStartElement(prefix, "ejb-local-ref", "http://java.sun.com/xml/ns/javaee");
                writeEjbLocalRef(writer, ejbLocalRefItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "ejbLocalRef");
            }
        }
    }
    // ELEMENT: serviceRef
    final KeyedCollection<String, ServiceRef> serviceRef = interceptor.serviceRef;
    if (serviceRef != null) {
        for (final ServiceRef serviceRefItem : serviceRef) {
            if (serviceRefItem != null) {
                writer.writeStartElement(prefix, "service-ref", "http://java.sun.com/xml/ns/javaee");
                writeServiceRef(writer, serviceRefItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "serviceRef");
            }
        }
    }
    // ELEMENT: resourceRef
    final KeyedCollection<String, ResourceRef> resourceRef = interceptor.resourceRef;
    if (resourceRef != null) {
        for (final ResourceRef resourceRefItem : resourceRef) {
            if (resourceRefItem != null) {
                writer.writeStartElement(prefix, "resource-ref", "http://java.sun.com/xml/ns/javaee");
                writeResourceRef(writer, resourceRefItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "resourceRef");
            }
        }
    }
    // ELEMENT: resourceEnvRef
    final KeyedCollection<String, ResourceEnvRef> resourceEnvRef = interceptor.resourceEnvRef;
    if (resourceEnvRef != null) {
        for (final ResourceEnvRef resourceEnvRefItem : resourceEnvRef) {
            if (resourceEnvRefItem != null) {
                writer.writeStartElement(prefix, "resource-env-ref", "http://java.sun.com/xml/ns/javaee");
                writeResourceEnvRef(writer, resourceEnvRefItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "resourceEnvRef");
            }
        }
    }
    // ELEMENT: messageDestinationRef
    final KeyedCollection<String, MessageDestinationRef> messageDestinationRef = interceptor.messageDestinationRef;
    if (messageDestinationRef != null) {
        for (final MessageDestinationRef messageDestinationRefItem : messageDestinationRef) {
            if (messageDestinationRefItem != null) {
                writer.writeStartElement(prefix, "message-destination-ref", "http://java.sun.com/xml/ns/javaee");
                writeMessageDestinationRef(writer, messageDestinationRefItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "messageDestinationRef");
            }
        }
    }
    // ELEMENT: persistenceContextRef
    final KeyedCollection<String, PersistenceContextRef> persistenceContextRef = interceptor.persistenceContextRef;
    if (persistenceContextRef != null) {
        for (final PersistenceContextRef persistenceContextRefItem : persistenceContextRef) {
            if (persistenceContextRefItem != null) {
                writer.writeStartElement(prefix, "persistence-context-ref", "http://java.sun.com/xml/ns/javaee");
                writePersistenceContextRef(writer, persistenceContextRefItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "persistenceContextRef");
            }
        }
    }
    // ELEMENT: persistenceUnitRef
    final KeyedCollection<String, PersistenceUnitRef> persistenceUnitRef = interceptor.persistenceUnitRef;
    if (persistenceUnitRef != null) {
        for (final PersistenceUnitRef persistenceUnitRefItem : persistenceUnitRef) {
            if (persistenceUnitRefItem != null) {
                writer.writeStartElement(prefix, "persistence-unit-ref", "http://java.sun.com/xml/ns/javaee");
                writePersistenceUnitRef(writer, persistenceUnitRefItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "persistenceUnitRef");
            }
        }
    }
    // ELEMENT: postConstruct
    final List<org.apache.openejb.jee.LifecycleCallback> postConstruct = interceptor.postConstruct;
    if (postConstruct != null) {
        for (final org.apache.openejb.jee.LifecycleCallback postConstructItem : postConstruct) {
            if (postConstructItem != null) {
                writer.writeStartElement(prefix, "post-construct", "http://java.sun.com/xml/ns/javaee");
                writeLifecycleCallback(writer, postConstructItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "postConstruct");
            }
        }
    }
    // ELEMENT: preDestroy
    final List<org.apache.openejb.jee.LifecycleCallback> preDestroy = interceptor.preDestroy;
    if (preDestroy != null) {
        for (final org.apache.openejb.jee.LifecycleCallback preDestroyItem : preDestroy) {
            if (preDestroyItem != null) {
                writer.writeStartElement(prefix, "pre-destroy", "http://java.sun.com/xml/ns/javaee");
                writeLifecycleCallback(writer, preDestroyItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "preDestroy");
            }
        }
    }
    // ELEMENT: dataSource
    final KeyedCollection<String, DataSource> dataSource = interceptor.dataSource;
    if (dataSource != null) {
        for (final DataSource dataSourceItem : dataSource) {
            if (dataSourceItem != null) {
                writer.writeStartElement(prefix, "data-source", "http://java.sun.com/xml/ns/javaee");
                writeDataSource(writer, dataSourceItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "dataSource");
            }
        }
    }
    // ELEMENT: postActivate
    final List<org.apache.openejb.jee.LifecycleCallback> postActivate = interceptor.postActivate;
    if (postActivate != null) {
        for (final org.apache.openejb.jee.LifecycleCallback postActivateItem : postActivate) {
            if (postActivateItem != null) {
                writer.writeStartElement(prefix, "post-activate", "http://java.sun.com/xml/ns/javaee");
                writeLifecycleCallback(writer, postActivateItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "postActivate");
            }
        }
    }
    // ELEMENT: prePassivate
    final List<org.apache.openejb.jee.LifecycleCallback> prePassivate = interceptor.prePassivate;
    if (prePassivate != null) {
        for (final org.apache.openejb.jee.LifecycleCallback prePassivateItem : prePassivate) {
            if (prePassivateItem != null) {
                writer.writeStartElement(prefix, "pre-passivate", "http://java.sun.com/xml/ns/javaee");
                writeLifecycleCallback(writer, prePassivateItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "prePassivate");
            }
        }
    }
    // ELEMENT: afterBegin
    final List<org.apache.openejb.jee.LifecycleCallback> afterBegin = interceptor.afterBegin;
    if (afterBegin != null) {
        for (final org.apache.openejb.jee.LifecycleCallback afterBeginItem : afterBegin) {
            if (afterBeginItem != null) {
                writer.writeStartElement(prefix, "after-begin", "http://java.sun.com/xml/ns/javaee");
                writeLifecycleCallback(writer, afterBeginItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "afterBegin");
            }
        }
    }
    // ELEMENT: beforeCompletion
    final List<org.apache.openejb.jee.LifecycleCallback> beforeCompletion = interceptor.beforeCompletion;
    if (beforeCompletion != null) {
        for (final org.apache.openejb.jee.LifecycleCallback beforeCompletionItem : beforeCompletion) {
            if (beforeCompletionItem != null) {
                writer.writeStartElement(prefix, "before-completion", "http://java.sun.com/xml/ns/javaee");
                writeLifecycleCallback(writer, beforeCompletionItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "beforeCompletion");
            }
        }
    }
    // ELEMENT: afterCompletion
    final List<org.apache.openejb.jee.LifecycleCallback> afterCompletion = interceptor.afterCompletion;
    if (afterCompletion != null) {
        for (final org.apache.openejb.jee.LifecycleCallback afterCompletionItem : afterCompletion) {
            if (afterCompletionItem != null) {
                writer.writeStartElement(prefix, "after-completion", "http://java.sun.com/xml/ns/javaee");
                writeLifecycleCallback(writer, afterCompletionItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(interceptor, "afterCompletion");
            }
        }
    }
    context.afterMarshal(interceptor, org.metatype.sxc.jaxb.LifecycleCallback.NONE);
}
Also used : PersistenceContextRef$JAXB.readPersistenceContextRef(org.apache.openejb.jee.PersistenceContextRef$JAXB.readPersistenceContextRef) PersistenceContextRef$JAXB.writePersistenceContextRef(org.apache.openejb.jee.PersistenceContextRef$JAXB.writePersistenceContextRef) MessageDestinationRef$JAXB.writeMessageDestinationRef(org.apache.openejb.jee.MessageDestinationRef$JAXB.writeMessageDestinationRef) MessageDestinationRef$JAXB.readMessageDestinationRef(org.apache.openejb.jee.MessageDestinationRef$JAXB.readMessageDestinationRef) EjbRef$JAXB.readEjbRef(org.apache.openejb.jee.EjbRef$JAXB.readEjbRef) EjbRef$JAXB.writeEjbRef(org.apache.openejb.jee.EjbRef$JAXB.writeEjbRef) AroundInvoke$JAXB.writeAroundInvoke(org.apache.openejb.jee.AroundInvoke$JAXB.writeAroundInvoke) AroundInvoke$JAXB.readAroundInvoke(org.apache.openejb.jee.AroundInvoke$JAXB.readAroundInvoke) ResourceEnvRef$JAXB.readResourceEnvRef(org.apache.openejb.jee.ResourceEnvRef$JAXB.readResourceEnvRef) ResourceEnvRef$JAXB.writeResourceEnvRef(org.apache.openejb.jee.ResourceEnvRef$JAXB.writeResourceEnvRef) PersistenceUnitRef$JAXB.readPersistenceUnitRef(org.apache.openejb.jee.PersistenceUnitRef$JAXB.readPersistenceUnitRef) PersistenceUnitRef$JAXB.writePersistenceUnitRef(org.apache.openejb.jee.PersistenceUnitRef$JAXB.writePersistenceUnitRef) EnvEntry$JAXB.readEnvEntry(org.apache.openejb.jee.EnvEntry$JAXB.readEnvEntry) EnvEntry$JAXB.writeEnvEntry(org.apache.openejb.jee.EnvEntry$JAXB.writeEnvEntry) EjbLocalRef$JAXB.writeEjbLocalRef(org.apache.openejb.jee.EjbLocalRef$JAXB.writeEjbLocalRef) EjbLocalRef$JAXB.readEjbLocalRef(org.apache.openejb.jee.EjbLocalRef$JAXB.readEjbLocalRef) CollapsedStringAdapter(javax.xml.bind.annotation.adapters.CollapsedStringAdapter) Text$JAXB.readText(org.apache.openejb.jee.Text$JAXB.readText) Text$JAXB.writeText(org.apache.openejb.jee.Text$JAXB.writeText) AroundTimeout$JAXB.readAroundTimeout(org.apache.openejb.jee.AroundTimeout$JAXB.readAroundTimeout) AroundTimeout$JAXB.writeAroundTimeout(org.apache.openejb.jee.AroundTimeout$JAXB.writeAroundTimeout) DataSource$JAXB.writeDataSource(org.apache.openejb.jee.DataSource$JAXB.writeDataSource) DataSource$JAXB.readDataSource(org.apache.openejb.jee.DataSource$JAXB.readDataSource) ResourceRef$JAXB.readResourceRef(org.apache.openejb.jee.ResourceRef$JAXB.readResourceRef) ResourceRef$JAXB.writeResourceRef(org.apache.openejb.jee.ResourceRef$JAXB.writeResourceRef) LifecycleCallback$JAXB.readLifecycleCallback(org.apache.openejb.jee.LifecycleCallback$JAXB.readLifecycleCallback) LifecycleCallback$JAXB.writeLifecycleCallback(org.apache.openejb.jee.LifecycleCallback$JAXB.writeLifecycleCallback) RuntimeContext(org.metatype.sxc.jaxb.RuntimeContext) ServiceRef$JAXB.readServiceRef(org.apache.openejb.jee.ServiceRef$JAXB.readServiceRef) ServiceRef$JAXB.writeServiceRef(org.apache.openejb.jee.ServiceRef$JAXB.writeServiceRef)

Aggregations

DataSource$JAXB.readDataSource (org.apache.openejb.jee.DataSource$JAXB.readDataSource)14 DataSource$JAXB.writeDataSource (org.apache.openejb.jee.DataSource$JAXB.writeDataSource)14 EjbLocalRef$JAXB.readEjbLocalRef (org.apache.openejb.jee.EjbLocalRef$JAXB.readEjbLocalRef)14 EjbLocalRef$JAXB.writeEjbLocalRef (org.apache.openejb.jee.EjbLocalRef$JAXB.writeEjbLocalRef)14 EjbRef$JAXB.readEjbRef (org.apache.openejb.jee.EjbRef$JAXB.readEjbRef)14 EjbRef$JAXB.writeEjbRef (org.apache.openejb.jee.EjbRef$JAXB.writeEjbRef)14 EnvEntry$JAXB.readEnvEntry (org.apache.openejb.jee.EnvEntry$JAXB.readEnvEntry)14 EnvEntry$JAXB.writeEnvEntry (org.apache.openejb.jee.EnvEntry$JAXB.writeEnvEntry)14 MessageDestinationRef$JAXB.readMessageDestinationRef (org.apache.openejb.jee.MessageDestinationRef$JAXB.readMessageDestinationRef)14 MessageDestinationRef$JAXB.writeMessageDestinationRef (org.apache.openejb.jee.MessageDestinationRef$JAXB.writeMessageDestinationRef)14 PersistenceContextRef$JAXB.readPersistenceContextRef (org.apache.openejb.jee.PersistenceContextRef$JAXB.readPersistenceContextRef)14 PersistenceContextRef$JAXB.writePersistenceContextRef (org.apache.openejb.jee.PersistenceContextRef$JAXB.writePersistenceContextRef)14 PersistenceUnitRef$JAXB.readPersistenceUnitRef (org.apache.openejb.jee.PersistenceUnitRef$JAXB.readPersistenceUnitRef)14 PersistenceUnitRef$JAXB.writePersistenceUnitRef (org.apache.openejb.jee.PersistenceUnitRef$JAXB.writePersistenceUnitRef)14 ResourceEnvRef$JAXB.readResourceEnvRef (org.apache.openejb.jee.ResourceEnvRef$JAXB.readResourceEnvRef)14 ResourceEnvRef$JAXB.writeResourceEnvRef (org.apache.openejb.jee.ResourceEnvRef$JAXB.writeResourceEnvRef)14 ResourceRef$JAXB.readResourceRef (org.apache.openejb.jee.ResourceRef$JAXB.readResourceRef)14 ResourceRef$JAXB.writeResourceRef (org.apache.openejb.jee.ResourceRef$JAXB.writeResourceRef)14 ServiceRef$JAXB.readServiceRef (org.apache.openejb.jee.ServiceRef$JAXB.readServiceRef)14 ServiceRef$JAXB.writeServiceRef (org.apache.openejb.jee.ServiceRef$JAXB.writeServiceRef)14