• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java BootstrapContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中javax.resource.spi.BootstrapContext的典型用法代码示例。如果您正苦于以下问题:Java BootstrapContext类的具体用法?Java BootstrapContext怎么用?Java BootstrapContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BootstrapContext类属于javax.resource.spi包,在下文中一共展示了BootstrapContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: start

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
/**
 * This is called when a resource adapter instance is bootstrapped.
 *
 * @param ctx
 *            A bootstrap context containing references
 * @throws ResourceAdapterInternalException
 *             indicates bootstrap failure.
 */
public void start(BootstrapContext ctx)
		throws ResourceAdapterInternalException {
	log.tracef("start(%s)", ctx);
	this.bootstrapContext = ctx;
	rabbitCF = new ConnectionFactory();
	try {
		rabbitCF.setUri(uri);
		rabbitCF.setConnectionTimeout(getConnectionTimeout());
		rabbitCF.setRequestedHeartbeat(getRequestedHeartbeat());
	} catch (KeyManagementException | NoSuchAlgorithmException
			| URISyntaxException e) {
		throw new ResourceAdapterInternalException(e);
	}

}
 
开发者ID:leogsilva,项目名称:rabbitmq-resource-adapter,代码行数:24,代码来源:RabbitmqResourceAdapter.java


示例2: start

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
/**
 * Start
 *
 * @param ctx The bootstrap context
 * @throws ResourceAdapterInternalException Thrown if an error occurs
 */
@Override
public void start(final BootstrapContext ctx) throws ResourceAdapterInternalException {
   if (logger.isTraceEnabled()) {
      logger.trace("start(" + ctx + ")");
   }

   tm = ServiceUtils.getTransactionManager();

   recoveryManager.start(useAutoRecovery);

   this.ctx = ctx;

   if (!configured.getAndSet(true)) {
      try {
         setup();
      } catch (ActiveMQException e) {
         throw new ResourceAdapterInternalException("Unable to create activation", e);
      }
   }

   ActiveMQRALogger.LOGGER.resourceAdaptorStarted();
}
 
开发者ID:apache,项目名称:activemq-artemis,代码行数:29,代码来源:ActiveMQResourceAdapter.java


示例3: start

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
@Override
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
	log.debug("");

	workManager = ctx.getWorkManager();
	xaTerminator = ctx.getXATerminator();
	try {
		timer = ctx.createTimer();

		perMinuteTimerTask = new PerMinuteTimerTask();
		perMinuteTimerTask.init();
		timer.schedule(perMinuteTimerTask, perMinuteTimerTask.getDelay(), perMinuteTimerTask.getPeriod());
	} catch (UnavailableException e) {
		log.warn("", e);
		//throw new ResourceAdapterInternalException(e);
	}
	//bind();
	log.debug("workManager={}, xaTerminator={}, timer={}", workManager, xaTerminator, timer);
}
 
开发者ID:dlmiles,项目名称:full-example-ee7-jca-eis,代码行数:20,代码来源:ResourceAdapterImpl.java


示例4: ResourceAdapterImpl

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
/**
 * Constructor
 * @param resourceAdapter The resource adapter
 * @param bc The BootstrapContext
 * @param configProperties The configuration properties
 * @param statistics The statistics
 * @param productName The product name
 * @param productVersion The product version
 * @param messageListeners The message listeners
 * @param is16 Is a 1.6+ archive
 * @param beanValidation Bean validation
 * @param bvGroups The bean validation groups
 * @param ti The transaction integration
 */
public ResourceAdapterImpl(javax.resource.spi.ResourceAdapter resourceAdapter,
                           BootstrapContext bc,
                           Collection<ConfigProperty> configProperties,
                           StatisticsPlugin statistics,
                           String productName, String productVersion,
                           Map<String, ActivationSpecImpl> messageListeners,
                           boolean is16, BeanValidation beanValidation, List<String> bvGroups,
                           TransactionIntegration ti)
{
   this.activated = false;
   this.resourceAdapter = resourceAdapter;
   this.bc = bc;
   this.configProperties = configProperties;
   this.statistics = statistics;
   this.productName = productName;
   this.productVersion = productVersion;
   this.messageListeners = messageListeners;
   this.is16 = is16;
   this.beanValidation = beanValidation;
   this.bvGroups = bvGroups;
   this.activeEndpoints = new HashMap<>();
   this.transactionIntegration = ti;
}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:38,代码来源:ResourceAdapterImpl.java


示例5: start

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {

    try {
      Class.forName(ORG_CAMUNDA_BPM_ENGINE_PROCESS_ENGINE);
    } catch (Exception e) {
      log.info("ProcessEngine classes not found in shared libraries. Not initializing camunda Platform JobExecutor Resource Adapter.");
      return;
    }

    // initialize the ExecutorService (CommonJ or JCA, depending on configuration)
    if(isUseCommonJWorkManager) {
      if(commonJWorkManagerName != null & commonJWorkManagerName.length() > 0) {
        executorServiceWrapper.setExecutorService(new CommonJWorkManagerExecutorService(this, commonJWorkManagerName));
      } else {
        throw new RuntimeException("Resource Adapter configuration property 'isUseCommonJWorkManager' is set to true but 'commonJWorkManagerName' is not provided.");
      }

    } else {
      executorServiceWrapper.setExecutorService(new JcaWorkManagerExecutorService(this, ctx.getWorkManager()));
    }

    log.log(Level.INFO, "camunda BPM executor service started.");
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:24,代码来源:JcaExecutorServiceConnector.java


示例6: postProcessBeanFactory

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
@Override
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
	beanFactory.addBeanPostProcessor(new BootstrapContextAwareProcessor(this.bootstrapContext));
	beanFactory.ignoreDependencyInterface(BootstrapContextAware.class);
	beanFactory.registerResolvableDependency(BootstrapContext.class, this.bootstrapContext);

	// JCA WorkManager resolved lazily - may not be available.
	beanFactory.registerResolvableDependency(WorkManager.class, new ObjectFactory<WorkManager>() {
		@Override
		public WorkManager getObject() {
			return bootstrapContext.getWorkManager();
		}
	});
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:ResourceAdapterApplicationContext.java


示例7: start

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
/**
 * This implementation loads a Spring ApplicationContext through the
 * {@link #createApplicationContext} template method.
 */
@Override
public void start(BootstrapContext bootstrapContext) throws ResourceAdapterInternalException {
	if (logger.isInfoEnabled()) {
		logger.info("Starting SpringContextResourceAdapter with BootstrapContext: " + bootstrapContext);
	}
	this.applicationContext = createApplicationContext(bootstrapContext);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:12,代码来源:SpringContextResourceAdapter.java


示例8: createApplicationContext

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
/**
 * Build a Spring ApplicationContext for the given JCA BootstrapContext.
 * <p>The default implementation builds a {@link ResourceAdapterApplicationContext}
 * and delegates to {@link #loadBeanDefinitions} for actually parsing the
 * specified configuration files.
 * @param bootstrapContext this ResourceAdapter's BootstrapContext
 * @return the Spring ApplicationContext instance
 */
protected ConfigurableApplicationContext createApplicationContext(BootstrapContext bootstrapContext) {
	ResourceAdapterApplicationContext applicationContext =
			new ResourceAdapterApplicationContext(bootstrapContext);
	// Set ResourceAdapter's ClassLoader as bean class loader.
	applicationContext.setClassLoader(getClass().getClassLoader());
	// Extract individual config locations.
	String[] configLocations =
			StringUtils.tokenizeToStringArray(getContextConfigLocation(), CONFIG_LOCATION_DELIMITERS);
	if (configLocations != null) {
		loadBeanDefinitions(applicationContext, configLocations);
	}
	applicationContext.refresh();
	return applicationContext;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:SpringContextResourceAdapter.java


示例9: postProcessBeanFactory

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
@Override
protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
	beanFactory.addBeanPostProcessor(new BootstrapContextAwareProcessor(this.bootstrapContext));
	beanFactory.ignoreDependencyInterface(BootstrapContextAware.class);
	beanFactory.registerResolvableDependency(BootstrapContext.class, this.bootstrapContext);

	// JCA WorkManager resolved lazily - may not be available.
	beanFactory.registerResolvableDependency(WorkManager.class, new ObjectFactory<WorkManager>() {
		public WorkManager getObject() {
			return bootstrapContext.getWorkManager();
		}
	});
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:14,代码来源:ResourceAdapterApplicationContext.java


示例10: start

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
/**
 * This implementation loads a Spring ApplicationContext through the
 * {@link #createApplicationContext} template method.
 */
public void start(BootstrapContext bootstrapContext) throws ResourceAdapterInternalException {
	if (logger.isInfoEnabled()) {
		logger.info("Starting SpringContextResourceAdapter with BootstrapContext: " + bootstrapContext);
	}
	this.applicationContext = createApplicationContext(bootstrapContext);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:11,代码来源:SpringContextResourceAdapter.java


示例11: start

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
@Override
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
    log.info("[TrafficResourceAdapter] start()");
    /* Get the work manager from the container to submit tasks to
     * be executed in container-managed threads */
    workManager = ctx.getWorkManager();
}
 
开发者ID:osmanpub,项目名称:oracle-samples,代码行数:8,代码来源:TrafficResourceAdapter.java


示例12: start

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
@Override
public void start(BootstrapContext bootstrapContext) throws ResourceAdapterInternalException {
	this.bootstrapContext = bootstrapContext;
	
	try {
		fileSystem = FileSystems.getDefault();
		watchService = fileSystem.newWatchService();
	} catch (IOException e) {
		throw new ResourceAdapterInternalException(e);
	}
	
	new FSWatchingThread(watchService, this).start();
}
 
开发者ID:robertpanzer,项目名称:filesystemwatch-connector,代码行数:14,代码来源:FSWatcherResourceAdapter.java


示例13: start

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public void start(BootstrapContext ctx)
      throws ResourceAdapterInternalException
{
   this.bc = (CloneableBootstrapContext) ctx;
   this.workManager = ctx.getWorkManager();
}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:10,代码来源:TestResourceAdapter.java


示例14: testDeployment

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
/**
 * Deployment
 * @throws Throwable In case of an error
 */
@Test
public void testDeployment() throws Throwable
{
   assertNotNull(cf);
   assertNotNull(cf2);

   TestConnection conn = cf.getConnection();
   assertNotNull(conn);
   TestConnection conn2 = cf2.getConnection();
   assertNotNull(conn2);

   assertNotEquals(conn, conn2);

   assertNotEquals(conn.getWorkManager(), conn2.getWorkManager());
   assertEquals("Default", conn.getWorkManagerName());
   assertEquals("WorkManager2", conn2.getWorkManagerName());

   assertTrue(conn.getBootstrapContext() instanceof BootstrapContext);
   assertTrue(conn.getBootstrapContext() instanceof org.ironjacamar.core.api.bootstrapcontext.BootstrapContext);
   assertTrue(conn.getBootstrapContext() instanceof CloneableBootstrapContext);
   assertTrue(conn2.getBootstrapContext() instanceof BootstrapContext);
   assertTrue(conn2.getBootstrapContext() instanceof org.ironjacamar.core.api.bootstrapcontext.BootstrapContext);
   assertTrue(conn2.getBootstrapContext() instanceof CloneableBootstrapContext);

   assertNotEquals(((CloneableBootstrapContext) conn.getBootstrapContext()).getId(),
         ((CloneableBootstrapContext) conn2.getBootstrapContext()).getId());
   assertNotEquals(((CloneableBootstrapContext) conn.getBootstrapContext()).getName(),
         ((CloneableBootstrapContext) conn2.getBootstrapContext()).getName());
   assertEquals(conn.getBootstrapContext().getTransactionSynchronizationRegistry(),
         conn2.getBootstrapContext().getTransactionSynchronizationRegistry());

   conn.close();
   conn2.close();

}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:40,代码来源:CustomBootstrapAndWorkmanagerTestCase.java


示例15: testDeployment

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
/**
 * Deployment
 * @throws Throwable In case of an error
 */
@Test
public void testDeployment() throws Throwable
{
   assertNotNull(cf);
   assertNotNull(cf2);

   TestConnection conn = cf.getConnection();
   assertNotNull(conn);
   TestConnection conn2 = cf2.getConnection();
   assertNotNull(conn2);

   assertNotEquals(conn, conn2);

   assertEquals(conn.getWorkManager(), conn2.getWorkManager());

   assertTrue(conn.getBootstrapContext() instanceof BootstrapContext);
   assertTrue(conn.getBootstrapContext() instanceof org.ironjacamar.core.api.bootstrapcontext.BootstrapContext);
   assertTrue(conn.getBootstrapContext() instanceof CloneableBootstrapContext);

   assertEquals(((CloneableBootstrapContext) conn.getBootstrapContext()).getId(),
         ((CloneableBootstrapContext) conn2.getBootstrapContext()).getId());
   assertEquals(((CloneableBootstrapContext) conn.getBootstrapContext()).getName(),
         ((CloneableBootstrapContext) conn2.getBootstrapContext()).getName());
   assertEquals(conn.getBootstrapContext().getTransactionSynchronizationRegistry(),
         conn2.getBootstrapContext().getTransactionSynchronizationRegistry());

   conn.close();
   conn2.close();
}
 
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:34,代码来源:BootstrapContextTestCase.java


示例16: start

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
public void start(final BootstrapContext bootstrapContext) throws ResourceAdapterInternalException {
    assertFalse("Already started", started);
    assertNotNull("bootstrapContext is null", bootstrapContext);
    assertNotNull("bootstrapContext.getWorkManager() is null", bootstrapContext.getWorkManager());
    assertNotNull("bootstrapContext.getXATerminator() is null", bootstrapContext.getXATerminator());
    try {
        assertNotNull("bootstrapContext.createTimer() is null", bootstrapContext.createTimer());
    } catch (final UnavailableException e) {
        throw new ResourceAdapterInternalException("bootstrapContext.createTimer() threw an exception", e);
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:12,代码来源:MdbConfigTest.java


示例17: setUp

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    super.setUp();

    // create a transaction manager
    final GeronimoTransactionManager transactionManager = new GeronimoTransactionManager();

    // create the ActiveMQ resource adapter instance
    ra = new ActiveMQResourceAdapter();

    // initialize properties
    ra.setServerUrl(brokerAddress);
    ra.setBrokerXmlConfig(brokerXmlConfig);
    ra.setStartupTimeout(new Duration(10, TimeUnit.SECONDS));

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

    // 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);

    // start the resource adapter
    try {
        ra.start(bootstrapContext);
    } catch (final ResourceAdapterInternalException e) {
        throw new OpenEJBException(e);
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:37,代码来源:JmsTest.java


示例18: start

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
@Override
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
	LOGGER.debug("Starting JobExecutorResourceAdapter with workmanager");
	this.bootstrapCtx = ctx;

	initConfiguration();
	initJobAcquisitions();
}
 
开发者ID:agito-it,项目名称:activiti-jobexecutor-ee,代码行数:9,代码来源:JobExecutorResourceAdapter.java


示例19: BootstrapContextAwareProcessor

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
/**
 * Create a new BootstrapContextAwareProcessor for the given context.
 */
public BootstrapContextAwareProcessor(BootstrapContext bootstrapContext) {
	this.bootstrapContext = bootstrapContext;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:7,代码来源:BootstrapContextAwareProcessor.java


示例20: setBootstrapContext

import javax.resource.spi.BootstrapContext; //导入依赖的package包/类
/**
 * Specify the JCA BootstrapContext that contains the
 * WorkManager to delegate to.
 */
@Override
public void setBootstrapContext(BootstrapContext bootstrapContext) {
	Assert.notNull(bootstrapContext, "BootstrapContext must not be null");
	this.workManager = bootstrapContext.getWorkManager();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:WorkManagerTaskExecutor.java



注:本文中的javax.resource.spi.BootstrapContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AstyanaxContext类代码示例发布时间:2022-05-21
下一篇:
Java Util类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap