本文整理汇总了Java中javax.resource.spi.ResourceAdapter类的典型用法代码示例。如果您正苦于以下问题:Java ResourceAdapter类的具体用法?Java ResourceAdapter怎么用?Java ResourceAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResourceAdapter类属于javax.resource.spi包,在下文中一共展示了ResourceAdapter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}
示例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);
}
示例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)));
}