Package javax.resource.spi

Examples of javax.resource.spi.BootstrapContext


        // create a work manager which ActiveMQ uses to dispatch message delivery jobs
        WorkManager workManager = new GeronimoWorkManager(threadPool, threadPool, threadPool, transactionManager);

        // wrap the work mananger and transaction manager in a bootstrap context (connector spec thing)
        BootstrapContext bootstrapContext = new GeronimoBootstrapContext(workManager, transactionManager);

        // start the resource adapter
        try {
            ra.start(bootstrapContext);
        } catch (ResourceAdapterInternalException e) {
View Full Code Here


            // create a work manager which the resource adapter can use to dispatch messages or perform tasks
            WorkManager workManager = new GeronimoWorkManager(threadPool, threadPool, threadPool, geronimoTransactionManager);

            // wrap the work mananger and transaction manager in a bootstrap context (connector spec thing)
            BootstrapContext bootstrapContext = new GeronimoBootstrapContext(workManager, geronimoTransactionManager);

            // start the resource adapter
            try {
                logger.debug("createResource.startingResourceAdapter", serviceInfo.id, service.getClass().getName());
                resourceAdapter.start(bootstrapContext);
View Full Code Here

        }
    }

    public void testGetCorrectBootstrapContext() throws Exception {
        ResourceAdapterImpl rai = new ResourceAdapterImpl();
        BootstrapContext bc = EasyMock.createMock(BootstrapContext.class);
        assertNotNull("BootstrapContext not null", bc);
        rai.start(bc);
        assertEquals("BootstrapContext set", rai.getBootstrapContext(), bc);
    }
View Full Code Here

                workManager = new SimpleWorkManager(threadPool);
            }


            // BootstrapContext: wraps the WorkMananger and XATerminator
            BootstrapContext bootstrapContext;
            if (transactionManager instanceof XATerminator) {
                bootstrapContext = new SimpleBootstrapContext(workManager, (XATerminator) transactionManager);
            } else {
                bootstrapContext = new SimpleBootstrapContext(workManager);
            }
View Full Code Here

        ActiveMQResourceAdapter adapter = new ActiveMQResourceAdapter();
        adapter.setServerUrl(DEFAULT_HOST);
        adapter.setUserName(ActiveMQConnectionFactory.DEFAULT_USER);
        adapter.setPassword(ActiveMQConnectionFactory.DEFAULT_PASSWORD);
        adapter.start(new BootstrapContext() {
            public WorkManager getWorkManager() {
                return null;
            }

            public XATerminator getXATerminator() {
View Full Code Here

        ActiveMQResourceAdapter adapter = new ActiveMQResourceAdapter();
        adapter.setServerUrl(DEFAULT_HOST);
        adapter.setUserName(ActiveMQConnectionFactory.DEFAULT_USER);
        adapter.setPassword(ActiveMQConnectionFactory.DEFAULT_PASSWORD);
        adapter.start(new BootstrapContext() {
            public WorkManager getWorkManager() {
                return null;
            }

            public XATerminator getXATerminator() {
View Full Code Here

            } else {
                workManager = new SimpleWorkManager(threadPool);
            }

            // BootstrapContext: wraps the WorkMananger and XATerminator
            final BootstrapContext bootstrapContext;
            if (transactionManager instanceof GeronimoTransactionManager) {
                bootstrapContext = new GeronimoBootstrapContext(GeronimoWorkManager.class.cast(workManager),
                    (GeronimoTransactionManager) transactionManager,
                    (GeronimoTransactionManager) transactionManager);
            } else if (transactionManager instanceof XATerminator) {
View Full Code Here

        // create a work manager which ActiveMQ uses to dispatch message delivery jobs
        final TransactionContextHandler txWorkContextHandler = new TransactionContextHandler(transactionManager);
        final GeronimoWorkManager workManager = new GeronimoWorkManager(threadPool, threadPool, threadPool, Collections.<WorkContextHandler>singletonList(txWorkContextHandler));

        // wrap the work mananger and transaction manager in a bootstrap context (connector spec thing)
        final BootstrapContext bootstrapContext = new GeronimoBootstrapContext(workManager, transactionManager, transactionManager);

        // Create a ConnectionFactory
        connectionFactory = new ActiveMQConnectionFactory(brokerAddress);
        ra.setConnectionFactory(connectionFactory);
View Full Code Here

        raBootstrapContext = ctx;
    }

    public WorkManager getWorkManager() {
        if (getBootstrapContext() instanceof BootstrapContext) {
            BootstrapContext context = (BootstrapContext)getBootstrapContext();
            return context.getWorkManager();
        }
        return null;
    }
View Full Code Here

        }

        public void start() throws ResourceException {
            ExecutorFactory factory = broker.getContainer().getExecutorFactory();
            executor = factory.createExecutor("flow.jca." + spec.getDestination());
            BootstrapContext context = new SimpleBootstrapContext(new WorkManagerWrapper(executor));
            ra.start(context);
            spec.setResourceAdapter(ra);
            ra.endpointActivation(endpointFactory, spec);
        }
View Full Code Here

TOP

Related Classes of javax.resource.spi.BootstrapContext

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.