Package javax.resource.spi

Examples of javax.resource.spi.BootstrapContext


            spec.setActiveMQDestination(destination);
        }
        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


        raBootstrapContext = ctx;
    }

    public WorkManager getWorkManager() {
        if (getBootstrapContext() instanceof BootstrapContext) {
            BootstrapContext context = (BootstrapContext)getBootstrapContext();
            return context.getWorkManager();
        }
        return null;
    }
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) workManager,
                                                                (GeronimoTransactionManager) transactionManager,
                                                                (GeronimoTransactionManager) transactionManager);
            } else if (transactionManager instanceof XATerminator) {
View Full Code Here

       
      ActiveMQResourceAdapter adapter = new ActiveMQResourceAdapter();
      adapter.setServerUrl(DEFAULT_HOST);
      adapter.setUserName(ActiveMQConnection.DEFAULT_USER);
      adapter.setPassword(ActiveMQConnection.DEFAULT_PASSWORD);
      adapter.start(new BootstrapContext(){
      public WorkManager getWorkManager() {
        return null;
      }
      public XATerminator getXATerminator() {
        return null;
View Full Code Here

       
      ActiveMQResourceAdapter adapter = new ActiveMQResourceAdapter();
      adapter.setServerUrl(DEFAULT_HOST);
      adapter.setUserName(ActiveMQConnection.DEFAULT_USER);
      adapter.setPassword(ActiveMQConnection.DEFAULT_PASSWORD);
      adapter.start(new BootstrapContext(){
      public WorkManager getWorkManager() {
        return null;
      }
      public XATerminator getXATerminator() {
        return null;
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) 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

            } 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

        final MessageResourceAdapter resourceAdapter = context.mock(MessageResourceAdapter.class);
        final ActiveMQEndpointActivationKey key = context.mock(ActiveMQEndpointActivationKey.class);
        messageEndpoint = context.mock(MessageEndpointProxy.class);
        workManager = context.mock(WorkManager.class);
        final MessageActivationSpec messageActivationSpec = context.mock(MessageActivationSpec.class);
        final BootstrapContext boostrapContext = context.mock(BootstrapContext.class);
        context.checking(new Expectations() {{
            allowing(boostrapContext).getWorkManager(); will (returnValue(workManager));
            allowing(resourceAdapter).getBootstrapContext(); will (returnValue(boostrapContext));
            allowing(messageEndpointFactory).isDeliveryTransacted(with (any(Method.class))); will(returnValue(Boolean.FALSE));
            allowing(key).getMessageEndpointFactory();  will(returnValue(messageEndpointFactory));
View Full Code Here

       
      ActiveMQResourceAdapter adapter = new ActiveMQResourceAdapter();
      adapter.setServerUrl(DEFAULT_HOST);
      adapter.setUserName(ActiveMQConnection.DEFAULT_USER);
      adapter.setPassword(ActiveMQConnection.DEFAULT_PASSWORD);
      adapter.start(new BootstrapContext(){
      public WorkManager getWorkManager() {
        return null;
      }
      public XATerminator getXATerminator() {
        return null;
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.