Examples of WorkManager


Examples of javax.resource.spi.work.WorkManager

    }


    private static final class StubBootstrapContext implements BootstrapContext {
        public WorkManager getWorkManager() {
            return new WorkManager() {
                public void doWork(Work work) throws WorkException {
                    new Thread(work).start();
                }

                public void doWork(Work work, long arg1, ExecutionContext arg2, WorkListener arg3) throws WorkException {
View Full Code Here

Examples of javax.resource.spi.work.WorkManager

     */
    public void testGetSetWorkManager() throws Exception {
        GeronimoTransactionManager transactionManager = new GeronimoTransactionManager();
        GeronimoWorkManager manager = new GeronimoWorkManager(pool, pool, pool, transactionManager);
        GeronimoBootstrapContext context = new GeronimoBootstrapContext(manager, transactionManager);
        WorkManager wm = context.getWorkManager();

        assertSame("Make sure it is the same object", manager, wm);
    }
View Full Code Here

Examples of javax.resource.spi.work.WorkManager

     */
    public void testGetSetWorkManager() {
        TransactionContextManager transactionContextManager = new TransactionContextManager();
        GeronimoWorkManager manager = new GeronimoWorkManager(pool, pool, pool, transactionContextManager);
        BootstrapContextImpl context = new BootstrapContextImpl(manager);
        WorkManager wm = context.getWorkManager();

        assertSame("Make sure it is the same object", manager, wm);
    }
View Full Code Here

Examples of javax.resource.spi.work.WorkManager

                              throws ConnectorRuntimeException {
       
        String className = null;
        String methodName = "getInstance";
        Class cls = null;
        WorkManager wm = null;
       
        try {
            className = System.getProperty(WORK_MANAGER_CLASS, DEFAULT);

            // Default work manager implementation is not a singleton.
View Full Code Here

Examples of javax.resource.spi.work.WorkManager

        // create a thead pool for ActiveMQ
        Executor threadPool = Executors.newFixedThreadPool(30);

        // 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
View Full Code Here

Examples of javax.resource.spi.work.WorkManager

            int threadPoolSize = getIntProperty(serviceInfo.properties, "threadPoolSize", 30);
            if (threadPoolSize <= 0) throw new IllegalArgumentException("threadPoolSizes <= 0: " + threadPoolSize);
            Executor threadPool = Executors.newFixedThreadPool(threadPoolSize, new ResourceAdapterThreadFactory(serviceInfo.id));

            // 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
View Full Code Here

Examples of javax.resource.spi.work.WorkManager

                    .build(new Options(serviceInfo.properties, SystemInstance.get().getOptions()));
                logger.info("Thread pool size for '" + serviceInfo.id + "' is (" + threadPoolSize + ")");
            }

            // WorkManager: the resource adapter can use this to dispatch messages or perform tasks
            final WorkManager workManager;
            if (GeronimoTransactionManager.class.isInstance(transactionManager)) {
                final GeronimoTransactionManager geronimoTransactionManager = (GeronimoTransactionManager) transactionManager;
                final TransactionContextHandler txWorkContextHandler = new TransactionContextHandler(geronimoTransactionManager);

                // use id as default realm name if realm is not specified in service properties
View Full Code Here

Examples of javax.resource.spi.work.WorkManager


    private static final class StubBootstrapContext implements BootstrapContext {
        @Override
        public WorkManager getWorkManager() {
            return new WorkManager() {
                @Override
                public void doWork(Work work) throws WorkException {
                    new Thread(work).start();
                }
View Full Code Here

Examples of javax.resource.spi.work.WorkManager

    long txGenerator = System.currentTimeMillis();

    private static final class StubBootstrapContext implements BootstrapContext {
        public WorkManager getWorkManager() {
            return new WorkManager() {
                public void doWork(Work work) throws WorkException {
                    new Thread(work).start();
                }

                public void doWork(Work work, long arg1, ExecutionContext arg2, WorkListener arg3) throws WorkException {
View Full Code Here

Examples of org.apache.drill.exec.work.WorkManager

  private volatile RegistrationHandle handle;

  public Drillbit(DrillConfig config, RemoteServiceSet serviceSet) throws Exception {
    if(serviceSet != null){
      this.context = new BootStrapContext(config);
      this.manager = new WorkManager(context);
      this.coord = serviceSet.getCoordinator();
      this.engine = new ServiceEngine(manager.getBitComWorker(), manager.getUserWorker(), context);
      this.cache = serviceSet.getCache();
    }else{
      Runtime.getRuntime().addShutdownHook(new ShutdownThread(config));
      this.context = new BootStrapContext(config);
      this.manager = new WorkManager(context);
      this.coord = new ZKClusterCoordinator(config);
      this.engine = new ServiceEngine(manager.getBitComWorker(), manager.getUserWorker(), context);
      this.cache = new HazelCache(config);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.