Package org.jboss.as.ejb3.deployment

Examples of org.jboss.as.ejb3.deployment.EjbJarDescription


        }
        return activationConfigProps;
    }

    private void processMessageDrivenBeanMetaData(final DeploymentUnit deploymentUnit, final MessageDrivenBeanMetaData mdb) throws DeploymentUnitProcessingException {
        final EjbJarDescription ejbJarDescription = getEjbJarDescription(deploymentUnit);
        final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);

        final String beanName = mdb.getName();
        // the important bit is to skip already processed EJBs via annotations
        if (ejbJarDescription.hasComponent(beanName)) {
            final ComponentDescription description = eeModuleDescription.getComponentByName(beanName);
            if (description instanceof MessageDrivenComponentDescription) {
                ((MessageDrivenComponentDescription) description).setDescriptorData(mdb);
            } else {
                throw new DeploymentUnitProcessingException("MDB with name " + beanName + " referenced in ejb-jar.xml could not be created, as existing non MDB component with same name already exists: " + description);
            }
            return;
        }

        final String beanClassName = mdb.getEjbClass();
        String messageListenerInterface = mdb.getMessagingType();
        if (messageListenerInterface == null || messageListenerInterface.trim().isEmpty()) {
            // TODO: This isn't really correct to default to MessageListener
            messageListenerInterface = MessageListener.class.getName();
        }
        final Properties activationConfigProps = getActivationConfigProperties(mdb.getActivationConfig());
        final String defaultResourceAdapterName = this.getDefaultResourceAdapterName(deploymentUnit.getServiceRegistry());
        final MessageDrivenComponentDescription mdbComponentDescription = new MessageDrivenComponentDescription(beanName, beanClassName, ejbJarDescription, deploymentUnit.getServiceName(), messageListenerInterface, activationConfigProps, defaultResourceAdapterName);
        // add it to the ejb jar description
        ejbJarDescription.getEEModuleDescription().addComponent(mdbComponentDescription);
        mdbComponentDescription.setDescriptorData(mdb);
        mdbComponentDescription.setDeploymentDescriptorEnvironment(new DeploymentDescriptorEnvironment("java:comp/env/", mdb));
    }
View Full Code Here


        // Mark it as a EJB deployment
        EjbDeploymentMarker.mark(deploymentUnit);
        if (!deploymentUnit.hasAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_DESCRIPTION)) {
            final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION);
            final EjbJarDescription ejbModuleDescription = new EjbJarDescription(moduleDescription, applicationClassesDescription, deploymentUnit.getName().endsWith(".war"));
            deploymentUnit.putAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_DESCRIPTION, ejbModuleDescription);
        }

        // attach the EjbJarMetaData to the deployment unit
        deploymentUnit.putAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA, ejbJarMetaData);
View Full Code Here

    public void test1() {
        StatelessObjectFactory<MockBean> factory = new MockFactory();
        Pool<MockBean> pool = new StrictMaxPool<MockBean>(factory, 10, 1, TimeUnit.SECONDS);
        pool.start();

        MockBean beans[] = new MockBean[10];
        for (int i = 0; i < beans.length; i++) {
            beans[i] = pool.get();
        }

        for (int i = 0; i < beans.length; i++) {
View Full Code Here



        Callable<Void> task = new Callable<Void>() {
            public Void call() throws Exception {
                MockBean bean = pool.get();
                ready.countDown();
                in.await();
                pool.release(bean);

                bean = null;
View Full Code Here

    public void testTooMany() {
        StatelessObjectFactory<MockBean> factory = new MockFactory();
        Pool<MockBean> pool = new StrictMaxPool<MockBean>(factory, 10, 1, TimeUnit.SECONDS);
        pool.start();

        MockBean beans[] = new MockBean[10];
        for (int i = 0; i < beans.length; i++) {
            beans[i] = pool.get();
        }

        try {
View Full Code Here

        MockBean.reset();
        used = new AtomicInteger(0);
    }

    public void test1() {
        StatelessObjectFactory<MockBean> factory = new MockFactory();
        Pool<MockBean> pool = new StrictMaxPool<MockBean>(factory, 10, 1, TimeUnit.SECONDS);
        pool.start();

        MockBean beans[] = new MockBean[10];
        for (int i = 0; i < beans.length; i++) {
View Full Code Here

    /**
     * More threads than the pool size.
     */
    public void testMultiThread() throws Exception {
        StatelessObjectFactory<MockBean> factory = new MockFactory();
        final Pool<MockBean> pool = new StrictMaxPool<MockBean>(factory, 10, 60, TimeUnit.SECONDS);
        pool.start();

        final CountDownLatch in = new CountDownLatch(1);
        final CountDownLatch ready = new CountDownLatch(10);
View Full Code Here

        assertEquals(10, MockBean.getPostConstructs());
        assertEquals(10, MockBean.getPreDestroys());
    }

    public void testTooMany() {
        StatelessObjectFactory<MockBean> factory = new MockFactory();
        Pool<MockBean> pool = new StrictMaxPool<MockBean>(factory, 10, 1, TimeUnit.SECONDS);
        pool.start();

        MockBean beans[] = new MockBean[10];
        for (int i = 0; i < beans.length; i++) {
View Full Code Here

                        }
                    }
                });
            }
            // add the remote tx propagating interceptor
            view.getConfigurators().add(new EJBRemoteTransactionsViewConfigurator());
        }

    }
View Full Code Here

        ScheduleExpression everySecondExpression = this.getTimezoneSpecificScheduleExpression();
        everySecondExpression.second("*");
        everySecondExpression.minute("*");
        everySecondExpression.hour("*");

        CalendarBasedTimeout calendarTimeout = new CalendarBasedTimeout(everySecondExpression);

        Calendar firstTimeout = calendarTimeout.getFirstTimeout();
        Calendar nextTimeout = calendarTimeout.getNextTimeout(firstTimeout);

        Assert.assertNotNull("Next timeout is null", nextTimeout);
        Assert.assertNotNull("Next timeout is *before* the current time", nextTimeout.after(firstTimeout));
        logger.debug("Previous timeout was: " + firstTimeout.getTime() + " Next timeout is " + nextTimeout.getTime());
        long diff = nextTimeout.getTimeInMillis() - firstTimeout.getTimeInMillis();
View Full Code Here

TOP

Related Classes of org.jboss.as.ejb3.deployment.EjbJarDescription

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.