本文整理汇总了Java中javax.resource.spi.ResourceAdapter类的典型用法代码示例。如果您正苦于以下问题:Java ResourceAdapter类的具体用法?Java ResourceAdapter怎么用?Java ResourceAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResourceAdapter类属于javax.resource.spi包,在下文中一共展示了ResourceAdapter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createActivationSpec
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
@Override
public ActivationSpec createActivationSpec(ResourceAdapter adapter, JmsActivationSpecConfig config) {
Class<?> activationSpecClassToUse = this.activationSpecClass;
if (activationSpecClassToUse == null) {
activationSpecClassToUse = determineActivationSpecClass(adapter);
if (activationSpecClassToUse == null) {
throw new IllegalStateException("Property 'activationSpecClass' is required");
}
}
ActivationSpec spec = (ActivationSpec) BeanUtils.instantiateClass(activationSpecClassToUse);
BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(spec);
if (this.defaultProperties != null) {
bw.setPropertyValues(this.defaultProperties);
}
populateActivationSpecProperties(bw, config);
return spec;
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:19,代码来源:StandardJmsActivationSpecFactory.java
示例2: createActivationSpec
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
public ActivationSpec createActivationSpec(ResourceAdapter adapter, JmsActivationSpecConfig config) {
Class activationSpecClassToUse = this.activationSpecClass;
if (activationSpecClassToUse == null) {
activationSpecClassToUse = determineActivationSpecClass(adapter);
if (activationSpecClassToUse == null) {
throw new IllegalStateException("Property 'activationSpecClass' is required");
}
}
ActivationSpec spec = (ActivationSpec) BeanUtils.instantiateClass(activationSpecClassToUse);
BeanWrapper bw = PropertyAccessorFactory.forBeanPropertyAccess(spec);
if (this.defaultProperties != null) {
bw.setPropertyValues(this.defaultProperties);
}
populateActivationSpecProperties(bw, config);
return spec;
}
开发者ID:deathspeeder,项目名称:class-guard,代码行数:18,代码来源:StandardJmsActivationSpecFactory.java
示例3: validate
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
/**
* Validate
* @param v The validate object
* @param rb The resource bundle
* @return The list of failures found; <code>null</code> if none
*/
@SuppressWarnings("unchecked")
public List<Failure> validate(Validate v, ResourceBundle rb)
{
if (v != null &&
Key.RESOURCE_ADAPTER == v.getKey() &&
v.getClazz() != null &&
ResourceAdapter.class.isAssignableFrom(v.getClazz()))
{
ValidateClass vo = (ValidateClass)v;
if (vo.getConfigProperties() != null && !vo.getConfigProperties().isEmpty())
{
return ConfigPropertiesHelper.validateConfigPropertiesType(vo, SECTION,
rb.getString("ra.RAConfigProperties"));
}
}
return null;
}
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:25,代码来源:RAConfigProperties.java
示例4: validate
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
/**
* Validate
* @param vo The validate object
* @param rb The resource bundle
* @return The list of failures found; <code>null</code> if none
*/
@SuppressWarnings("unchecked")
public List<Failure> validate(Validate vo, ResourceBundle rb)
{
if (vo != null && Key.RESOURCE_ADAPTER == vo.getKey())
{
if (vo.getClazz() != null && !ResourceAdapter.class.isAssignableFrom(vo.getClazz()))
{
List<Failure> failures = new ArrayList<Failure>(1);
Failure failure = new Failure(Severity.ERROR,
SECTION,
rb.getString("ra.RA"),
vo.getClazz().getName());
failures.add(failure);
return failures;
}
}
return null;
}
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:28,代码来源:RA.java
示例5: XAResourceRecoveryInflowImpl
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
/**
* Constructor
*
* @param rar The resource adapter
* @param as The activation spec
* @param productName The product name
* @param productVersion The product version
*/
public XAResourceRecoveryInflowImpl(ResourceAdapter rar, ActivationSpec as,
String productName, String productVersion)
{
if (rar == null)
throw new IllegalArgumentException("ResourceAdapter is null");
if (as == null)
throw new IllegalArgumentException("ActivationSpec is null");
this.resourceAdapter = rar;
this.activationSpec = as;
this.productName = productName;
this.productVersion = productVersion;
this.jndiName = null;
}
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:24,代码来源:XAResourceRecoveryInflowImpl.java
示例6: setResourceAdapter
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
@Override
public void setResourceAdapter(ResourceAdapter ra)
throws ResourceException {
logger.debug("setting resource adapter");
logger.debug("ResourceAdapter: " + ra);
this.ra = (DataStorageResourceAdapter) ra;
}
开发者ID:psnc-dl,项目名称:darceo,代码行数:8,代码来源:DataStorageManagedConnectionFactory.java
示例7: setResourceAdapter
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
@Override
public void setResourceAdapter(ResourceAdapter ra)
throws ResourceException {
logger.debug("setting resource adapter");
logger.debug("ResourceAdapter: " + ra);
this.ra = (OwlimSemanticRepositoryResourceAdapter) ra;
}
开发者ID:psnc-dl,项目名称:darceo,代码行数:8,代码来源:OwlimSemanticRepositoryManagedConnectionFactory.java
示例8: contextDestroyed
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
public void contextDestroyed(ServletContextEvent event) {
ServletContext servletContext = event.getServletContext();
WebApplicationContext applicationContext = WebApplicationContextUtils
.getRequiredWebApplicationContext(servletContext);
ResourceAdapter resourceAdapter = (ResourceAdapter) applicationContext.getBean(ResourceAdapter.class);
resourceAdapter.stop();
}
开发者ID:yangting,项目名称:openjtcc,代码行数:8,代码来源:TransactionResourceAdapterListener.java
示例9: getResourceAdapter
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
/**
* Get the resource adapter
*
* @return The resource adapter
*/
@Override
public ResourceAdapter getResourceAdapter() {
if (ActiveMQRAManagedConnectionFactory.trace) {
ActiveMQRALogger.LOGGER.trace("getResourceAdapter()");
}
return ra;
}
开发者ID:apache,项目名称:activemq-artemis,代码行数:14,代码来源:ActiveMQRAManagedConnectionFactory.java
示例10: setResourceAdapter
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
/**
* Set the resource adapter
* <br>
* This should ensure that when the RA is stopped, this MCF will be stopped as well.
*
* @param ra The resource adapter
* @throws ResourceException Thrown if incorrect resource adapter
*/
@Override
public void setResourceAdapter(final ResourceAdapter ra) throws ResourceException {
if (ActiveMQRAManagedConnectionFactory.trace) {
ActiveMQRALogger.LOGGER.trace("setResourceAdapter(" + ra + ")");
}
if (ra == null || !(ra instanceof ActiveMQResourceAdapter)) {
throw new ResourceException("Resource adapter is " + ra);
}
this.ra = (ActiveMQResourceAdapter) ra;
this.ra.setManagedConnectionFactory(this);
}
开发者ID:apache,项目名称:activemq-artemis,代码行数:22,代码来源:ActiveMQRAManagedConnectionFactory.java
示例11: getResourceAdapter
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
/**
* Get the resource adapter
*
* @return The resource adapter
*/
@Override
public ResourceAdapter getResourceAdapter() {
if (logger.isTraceEnabled()) {
logger.trace("getResourceAdapter()");
}
return ra;
}
开发者ID:apache,项目名称:activemq-artemis,代码行数:14,代码来源:ActiveMQActivationSpec.java
示例12: setResourceAdapter
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
/**
* Set the resource adapter
*
* @param ra The resource adapter
* @throws ResourceException Thrown if incorrect resource adapter
*/
@Override
public void setResourceAdapter(final ResourceAdapter ra) throws ResourceException {
if (logger.isTraceEnabled()) {
logger.trace("setResourceAdapter(" + ra + ")");
}
if (ra == null || !(ra instanceof ActiveMQResourceAdapter)) {
throw new ResourceException("Resource adapter is " + ra);
}
this.ra = (ActiveMQResourceAdapter) ra;
}
开发者ID:apache,项目名称:activemq-artemis,代码行数:19,代码来源:ActiveMQActivationSpec.java
示例13: setResourceAdapter
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
/**
* @see javax.resource.spi.ResourceAdapterAssociation
*/
@Override
public void setResourceAdapter(ResourceAdapter ra) throws ResourceException {
if(this.resourceAdapter != null) { // FIXME can this be set twice for same instance?
throw new ResourceException("resourceAdapter is already set old=" +
((this.resourceAdapter == null) ? this.resourceAdapter : (this.resourceAdapter.getClass().getName() + "@" + Integer.toHexString(this.resourceAdapter.hashCode()))) +
"; new=" +
((ra == null) ? ra : (ra.getClass().getName() + "@" + Integer.toHexString(ra.hashCode()))));
}
this.resourceAdapter = ra;
log.debug("ra={}", ra);
}
开发者ID:dlmiles,项目名称:full-example-ee7-jca-eis,代码行数:15,代码来源:ManagedConnectionFactoryImpl.java
示例14: createXAResourceRecovery
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public XAResourceRecovery createXAResourceRecovery(ResourceAdapter rar,
ActivationSpec as,
String productName, String productVersion)
{
return new XAResourceRecoveryInflowImpl(rar, as, productName, productVersion);
}
开发者ID:ironjacamar,项目名称:ironjacamar,代码行数:10,代码来源:TransactionIntegrationImpl.java
示例15: MdbPoolContainer
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
public MdbPoolContainer(final Object containerID,
final SecurityService securityService,
final ResourceAdapter resourceAdapter,
final Class messageListenerInterface,
final Class activationSpecClass,
final boolean failOnUnknownActivationSpec,
final Duration accessTimeout,
final Duration closeTimeout,
final Pool.Builder poolBuilder,
final int callbackThreads,
final boolean useOneSchedulerThreadByBean,
final int evictionThreads
) {
this.containerID = containerID;
this.resourceAdapter = resourceAdapter;
this.messageListenerInterface = messageListenerInterface;
this.activationSpecClass = activationSpecClass;
this.failOnUnknownActivationSpec = failOnUnknownActivationSpec;
xaResourceWrapper = SystemInstance.get().getComponent(XAResourceWrapper.class);
inboundRecovery = SystemInstance.get().getComponent(InboundRecovery.class);
this.instanceManager = new MdbInstanceManager(
securityService,
resourceAdapter,
inboundRecovery,
containerID,
accessTimeout, closeTimeout, poolBuilder, callbackThreads,
useOneSchedulerThreadByBean ?
null :
Executors.newScheduledThreadPool(Math.max(evictionThreads, 1), new DaemonThreadFactory(containerID)));
}
开发者ID:apache,项目名称:tomee,代码行数:31,代码来源:MdbPoolContainer.java
示例16: MdbActivationContext
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
public MdbActivationContext(final ClassLoader classLoader, final BeanContext beanContext, final ResourceAdapter resourceAdapter, final EndpointFactory endpointFactory, final ActivationSpec activationSpec) {
this.classLoader = classLoader;
this.beanContext = beanContext;
this.resourceAdapter = resourceAdapter;
this.endpointFactory = endpointFactory;
this.activationSpec = activationSpec;
}
开发者ID:apache,项目名称:tomee,代码行数:8,代码来源:MdbPoolContainer.java
示例17: MdbContainer
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
public MdbContainer(final Object containerID, final SecurityService securityService, final ResourceAdapter resourceAdapter,
final Class messageListenerInterface, final Class activationSpecClass, final int instanceLimit,
final boolean failOnUnknownActivationSpec) {
this.containerID = containerID;
this.securityService = securityService;
this.resourceAdapter = resourceAdapter;
this.messageListenerInterface = messageListenerInterface;
this.activationSpecClass = activationSpecClass;
this.instanceLimit = instanceLimit;
this.failOnUnknownActivationSpec = failOnUnknownActivationSpec;
xaResourceWrapper = SystemInstance.get().getComponent(XAResourceWrapper.class);
inboundRecovery = SystemInstance.get().getComponent(InboundRecovery.class);
}
开发者ID:apache,项目名称:tomee,代码行数:14,代码来源:MdbContainer.java
示例18: setResourceAdapter
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
@Override
public void setResourceAdapter(ResourceAdapter ra) throws ResourceException {
LOGGER.trace("setResourceAdapter(ResourceAdapter)");
if (!JobExecutorResourceAdapter.class.isAssignableFrom(ra.getClass()))
throw new ResourceException("ResourceAdapter is not of type " + JobExecutorResourceAdapter.class.getName());
this.resourceAdapter = (JobExecutorResourceAdapter) ra;
}
开发者ID:agito-it,项目名称:activiti-jobexecutor-ee,代码行数:8,代码来源:JobExecutorManagedConnectionFactory.java
示例19: setResourceAdapter
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
@Override
public void setResourceAdapter(ResourceAdapter resourceAdapter) throws ResourceException {
LOGGER.trace("setResourceAdapter(resourceAdapter)");
if (!JobExecutorResourceAdapter.class.isAssignableFrom(resourceAdapter.getClass()))
throw new ResourceException("Invalid resource adapter type");
this.resourceAdapter = (JobExecutorResourceAdapter) resourceAdapter;
}
开发者ID:agito-it,项目名称:activiti-jobexecutor-ee,代码行数:8,代码来源:JobExecutorActivation.java
示例20: getObject
import javax.resource.spi.ResourceAdapter; //导入依赖的package包/类
@Override
public ResourceAdapter getObject() {
return this.resourceAdapter;
}
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:ResourceAdapterFactoryBean.java
注:本文中的javax.resource.spi.ResourceAdapter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论