Package org.apache.openejb.config.sys

Examples of org.apache.openejb.config.sys.Container


        assertNotNull(defaultStatelessContainer.className);
        assertNotNull(defaultStatelessContainer.constructorArgs);
        assertNotNull(defaultStatelessContainer.properties);

        // We should be able to create one of these with a different name
        Container container = new Container("My Stateless Container");
        StatelessSessionContainerInfo myStatelessContainer = factory.configureService(container, StatelessSessionContainerInfo.class);

        assertNotNull(myStatelessContainer);
        assertEquals("My Stateless Container", myStatelessContainer.id);
        assertEquals(defaultStatelessContainer.className, myStatelessContainer.className);
View Full Code Here


    public void testConfigureService2() throws Exception {
        ConfigurationFactory factory = new ConfigurationFactory();

        // We should be able to create one of these with a different name

        Container container = new Container("MyContainer", "STATELESS", "org.acme#CheddarContainer");
        StatelessSessionContainerInfo myStatelessContainer = factory.configureService(container, StatelessSessionContainerInfo.class);

        assertNotNull(myStatelessContainer);
        assertEquals("MyContainer", myStatelessContainer.id);
        assertEquals("org.acme.SuperContainer", myStatelessContainer.className);
View Full Code Here

    }

    public void testConfigureServiceOverriddenProperty() throws Exception {
        ConfigurationFactory factory = new ConfigurationFactory();

        Container container = new Container("MyContainer", "STATELESS", "org.acme#CheddarContainer");
        container.getProperties().setProperty("myProperty", "Cheese is good");

        StatelessSessionContainerInfo myStatelessContainer = factory.configureService(container, StatelessSessionContainerInfo.class);

        assertNotNull(myStatelessContainer);
        assertEquals("MyContainer", myStatelessContainer.id);
View Full Code Here

    }

    public void testConfigureServiceAddedProperty() throws Exception {
        ConfigurationFactory factory = new ConfigurationFactory();

        Container container = new Container("MyContainer", "STATELESS", "org.acme#CheddarContainer");
        container.getProperties().setProperty("anotherProperty", "Cheese is good");
        StatelessSessionContainerInfo myStatelessContainer = factory.configureService(container,  StatelessSessionContainerInfo.class);

        assertNotNull(myStatelessContainer);
        assertEquals("MyContainer", myStatelessContainer.id);
        assertEquals("org.acme.SuperContainer", myStatelessContainer.className);
View Full Code Here

    }

    public void testConfigureByType() throws Exception {
        ConfigurationFactory factory = new ConfigurationFactory();

        Container container = new Container("MyContainer", "STATELESS", null);
        container.getProperties().setProperty("anotherProperty", "Cheese is good");
        ContainerInfo myStatelessContainer = factory.configureService(container,  ContainerInfo.class);

        assertNotNull(myStatelessContainer);
        assertEquals("org.apache.openejb.core.stateless.StatelessContainer", myStatelessContainer.className);
    }
View Full Code Here

    public void testConfigureServiceAddedPropertyViaURI() throws Exception {
        ConfigurationFactory factory = new ConfigurationFactory();

        URI uri = new URI("new://Container?type=STATELESS&provider=org.acme%23CheddarContainer");

        Container container = (Container) factory.toConfigDeclaration("MyContainer", uri);

        container.getProperties().setProperty("anotherProperty", "Cheese is good");
        StatelessSessionContainerInfo myStatelessContainer = factory.configureService(container,  StatelessSessionContainerInfo.class);

        assertNotNull(myStatelessContainer);
        assertEquals("MyContainer", myStatelessContainer.id);
        assertEquals("org.acme.SuperContainer", myStatelessContainer.className);
View Full Code Here

    public void setProvider(String provider) {
        this.provider = provider;
    }

    public Container getContainerDefinition() throws OpenEJBException {
        Container container = new Container();
        container.setCtype(getContainerType());

        if (id != null) {
            container.setId(id);
        } else if (beanName != null) {
            container.setId(beanName);
        } else {
            throw new OpenEJBException("No id defined for SingletonContainer");
        }

        if (provider != null) {
            container.setProvider(provider);
        }

        Properties properties = getProperties();
        container.getProperties().putAll(properties);

        return container;
    }
View Full Code Here

            InboundResource inbound = resourceAdapter.getInboundResourceAdapter();
            if (inbound != null) {
                for (MessageListener messageListener : inbound.getMessageAdapter().getMessageListener()) {
                    String id = getId(messageListener, inbound, connectorModule);

                    Container container = new Container(id, "MESSAGE", null);

                    Properties properties = container.getProperties();
                    properties.setProperty("ResourceAdapter", connectorInfo.resourceAdapter.id);
                    properties.setProperty("MessageListenerInterface", messageListener.getMessageListenerType());
                    properties.setProperty("ActivationSpecClass", messageListener.getActivationSpec().getActivationSpecClass());

                    MdbContainerInfo mdbContainerInfo = configFactory.configureService(container, MdbContainerInfo.class);
View Full Code Here

            final InboundResourceadapter inbound = resourceAdapter.getInboundResourceAdapter();
            if (inbound != null) {
                for (final MessageListener messageListener : inbound.getMessageAdapter().getMessageListener()) {
                    final String id = this.getId(messageListener, inbound, connectorModule);

                    final Container container = new Container(id, "MESSAGE", null);

                    final Properties properties = container.getProperties();
                    properties.setProperty("ResourceAdapter", connectorInfo.resourceAdapter.id);
                    properties.setProperty("MessageListenerInterface", messageListener.getMessageListenerType());
                    properties.setProperty("ActivationSpecClass", messageListener.getActivationSpec().getActivationSpecClass());

                    final MdbContainerInfo mdbContainerInfo = this.configFactory.configureService(container, MdbContainerInfo.class);
View Full Code Here

        assertNotNull(defaultStatelessContainer.className);
        assertNotNull(defaultStatelessContainer.constructorArgs);
        assertNotNull(defaultStatelessContainer.properties);

        // We should be able to create one of these with a different name
        final Container container = new Container("My Stateless Container");
        final StatelessSessionContainerInfo myStatelessContainer = factory.configureService(container, StatelessSessionContainerInfo.class);

        assertNotNull(myStatelessContainer);
        assertEquals("My Stateless Container", myStatelessContainer.id);
        assertEquals(defaultStatelessContainer.className, myStatelessContainer.className);
View Full Code Here

TOP

Related Classes of org.apache.openejb.config.sys.Container

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.