Search in sources :

Example 16 with Empty

use of org.apache.openejb.jee.Empty in project tomee by apache.

the class JTAPuAndBmtTest method app.

@Module
public StatelessBean app() throws Exception {
    final StatelessBean bean = new StatelessBean(BmtManager.class);
    bean.setLocalBean(new Empty());
    return bean;
}
Also used : Empty(org.apache.openejb.jee.Empty) StatelessBean(org.apache.openejb.jee.StatelessBean) Module(org.apache.openejb.testing.Module)

Example 17 with Empty

use of org.apache.openejb.jee.Empty in project tomee by apache.

the class ResourceLocalEmInjectionTest method app.

@Module
public StatelessBean app() throws Exception {
    final StatelessBean bean = new StatelessBean(PersistManager.class);
    bean.setLocalBean(new Empty());
    return bean;
}
Also used : Empty(org.apache.openejb.jee.Empty) StatelessBean(org.apache.openejb.jee.StatelessBean) Module(org.apache.openejb.testing.Module)

Example 18 with Empty

use of org.apache.openejb.jee.Empty in project tomee by apache.

the class MethodPermission$JAXB method _write.

public static final void _write(final XoXMLStreamWriter writer, final MethodPermission methodPermission, RuntimeContext context) throws Exception {
    if (methodPermission == null) {
        writer.writeXsiNil();
        return;
    }
    if (context == null) {
        context = new RuntimeContext();
    }
    final String prefix = writer.getUniquePrefix("http://java.sun.com/xml/ns/javaee");
    if (MethodPermission.class != methodPermission.getClass()) {
        context.unexpectedSubclass(writer, methodPermission, MethodPermission.class);
        return;
    }
    context.beforeMarshal(methodPermission, LifecycleCallback.NONE);
    // ATTRIBUTE: id
    final String idRaw = methodPermission.id;
    if (idRaw != null) {
        String id = null;
        try {
            id = Adapters.collapsedStringAdapterAdapter.marshal(idRaw);
        } catch (final Exception e) {
            context.xmlAdapterError(methodPermission, "id", CollapsedStringAdapter.class, String.class, String.class, e);
        }
        writer.writeAttribute("", "", "id", id);
    }
    // ELEMENT: descriptions
    Text[] descriptions = null;
    try {
        descriptions = methodPermission.getDescriptions();
    } catch (final Exception e) {
        context.getterError(methodPermission, "descriptions", MethodPermission.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(methodPermission, "descriptions");
            }
        }
    }
    // ELEMENT: roleName
    final List<String> roleNameRaw = methodPermission.roleName;
    if (roleNameRaw != null) {
        for (final String roleNameItem : roleNameRaw) {
            String roleName = null;
            try {
                roleName = Adapters.collapsedStringAdapterAdapter.marshal(roleNameItem);
            } catch (final Exception e) {
                context.xmlAdapterError(methodPermission, "roleName", CollapsedStringAdapter.class, List.class, List.class, e);
            }
            if (roleName != null) {
                writer.writeStartElement(prefix, "role-name", "http://java.sun.com/xml/ns/javaee");
                writer.writeCharacters(roleName);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(methodPermission, "roleName");
            }
        }
    }
    // ELEMENT: unchecked
    final Empty unchecked = methodPermission.unchecked;
    if (unchecked != null) {
        writer.writeStartElement(prefix, "unchecked", "http://java.sun.com/xml/ns/javaee");
        writeEmpty(writer, unchecked, context);
        writer.writeEndElement();
    }
    // ELEMENT: method
    final List<Method> method = methodPermission.method;
    if (method != null) {
        for (final Method methodItem : method) {
            if (methodItem != null) {
                writer.writeStartElement(prefix, "method", "http://java.sun.com/xml/ns/javaee");
                writeMethod(writer, methodItem, context);
                writer.writeEndElement();
            } else {
                context.unexpectedNullValue(methodPermission, "method");
            }
        }
    }
    context.afterMarshal(methodPermission, LifecycleCallback.NONE);
}
Also used : Empty$JAXB.writeEmpty(org.apache.openejb.jee.Empty$JAXB.writeEmpty) Empty$JAXB.readEmpty(org.apache.openejb.jee.Empty$JAXB.readEmpty) 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) ArrayList(java.util.ArrayList) List(java.util.List) Method$JAXB.readMethod(org.apache.openejb.jee.Method$JAXB.readMethod) Method$JAXB.writeMethod(org.apache.openejb.jee.Method$JAXB.writeMethod) RuntimeContext(org.metatype.sxc.jaxb.RuntimeContext)

Example 19 with Empty

use of org.apache.openejb.jee.Empty in project tomee by apache.

the class RsInterceptorInjectionTest method service.

@Module
public static SingletonBean service() throws Exception {
    final SingletonBean bean = new SingletonBean(RsInjection.class);
    bean.setLocalBean(new Empty());
    return bean;
}
Also used : SingletonBean(org.apache.openejb.jee.SingletonBean) Empty(org.apache.openejb.jee.Empty) Module(org.apache.openejb.testing.Module)

Example 20 with Empty

use of org.apache.openejb.jee.Empty in project tomee by apache.

the class RsInjectionTest method service.

@Module
public static SingletonBean service() throws Exception {
    final SingletonBean bean = new SingletonBean(RsInjection.class);
    bean.setLocalBean(new Empty());
    return bean;
}
Also used : SingletonBean(org.apache.openejb.jee.SingletonBean) Empty(org.apache.openejb.jee.Empty) Module(org.apache.openejb.testing.Module)

Aggregations

Empty (org.apache.openejb.jee.Empty)19 Module (org.apache.openejb.testing.Module)18 StatelessBean (org.apache.openejb.jee.StatelessBean)12 Empty$JAXB.readEmpty (org.apache.openejb.jee.Empty$JAXB.readEmpty)10 Empty$JAXB.writeEmpty (org.apache.openejb.jee.Empty$JAXB.writeEmpty)10 Text$JAXB.readText (org.apache.openejb.jee.Text$JAXB.readText)10 Text$JAXB.writeText (org.apache.openejb.jee.Text$JAXB.writeText)10 RuntimeContext (org.metatype.sxc.jaxb.RuntimeContext)10 CollapsedStringAdapter (javax.xml.bind.annotation.adapters.CollapsedStringAdapter)6 SingletonBean (org.apache.openejb.jee.SingletonBean)6 ArrayList (java.util.ArrayList)5 QName (javax.xml.namespace.QName)5 EjbJar (org.apache.openejb.jee.EjbJar)5 Attribute (org.metatype.sxc.util.Attribute)5 XoXMLStreamReader (org.metatype.sxc.util.XoXMLStreamReader)5 EjbModule (org.apache.openejb.config.EjbModule)4 DataSource$JAXB.readDataSource (org.apache.openejb.jee.DataSource$JAXB.readDataSource)4 DataSource$JAXB.writeDataSource (org.apache.openejb.jee.DataSource$JAXB.writeDataSource)4 EjbLocalRef$JAXB.readEjbLocalRef (org.apache.openejb.jee.EjbLocalRef$JAXB.readEjbLocalRef)4 EjbLocalRef$JAXB.writeEjbLocalRef (org.apache.openejb.jee.EjbLocalRef$JAXB.writeEjbLocalRef)4