Java Code Examples for org.springframework.jca.support.ResourceAdapterFactoryBean

Following code examples demonstrate how to use org.springframework.jca.support.ResourceAdapterFactoryBeanfrom spring-framework. These examples are extracted from various highly rated open source projects. You can directly use these code snippets or view their entire linked source code. These snippets are extracted to provide contextual information about how to use this class in the real world. These samples also let you understand some good practices on how to use org.springframework.jca.support.ResourceAdapterFactoryBeanand various code implementation of this class.

	public ResourceAdapterFactoryBean tuxedoResourceAdapter() {
		try {
			SimpleNamingContextBuilder.emptyActivatedContextBuilder();
		} catch (NamingException e) {
			System.out.println("Simple Naming context builder error: "
					+ e.getMessage());
		}
		
		TuxedoResourceAdapter ra = new TuxedoResourceAdapter();
		ra.setTraceLevel("100000");

		ra.setDebugAdapter(true);
		ra.setDebugBuffer(true);
		ra.setDebugJatmi(true);
		ra.setDebugRouting(true);
		ra.setDebugSession(true);
		ra.setDebugXa(true);
		ra.setDebugConfig(true);
		ra.setDebugPdu(true);
		ra.setDebugPerf(true);
		ra.setDebugSec(true);
		ra.setDebugNet(true);

		ra.setXaAffinity("true");

		ra.setDmconfig("C:\\Users\\40042466\\workspace\\Silk Tuxedo\\configuration\\runtime\\dmconfig.xml");

		ResourceAdapterFactoryBean fc = new ResourceAdapterFactoryBean();
		fc.setResourceAdapter(ra);

		SimpleTaskWorkManager stwm = new SimpleTaskWorkManager();
		fc.setWorkManager(stwm);
		fc.setBootstrapContext(new SimpleBootstrapContext(stwm));

		return fc;
	} 


    ResourceAdapterFactoryBean resourceAdapterFactoryBean() {
        return new ResourceAdapterFactoryBean() {
            {
                setResourceAdapter(new ActiveMQResourceAdapter() {
                    {
                        setServerUrl(brokerURL);
                    }
                });
                setWorkManager(new SimpleTaskWorkManager());
            }
        };
    } 

	public void test() throws ResourceException {

		ResourceAdapterFactoryBean b = new ResourceAdapterFactoryBean();

		BootstrapContext bootstrapContext = null;
		ResourceAdapter resourceAdapter = null;
		Class<? extends ResourceAdapter> resourceAdapterClass = null;
		WorkManager workManager = null;
		XATerminator xaTerminator = null;

		b.afterPropertiesSet();
		b.destroy();
		b.getObject();
		b.getObjectType();
		b.isSingleton();
		b.setBootstrapContext(bootstrapContext);
		b.setResourceAdapter(resourceAdapter);
		b.setResourceAdapterClass(resourceAdapterClass);
		b.setWorkManager(workManager);
		b.setXaTerminator(xaTerminator);

		
	} 

Advertisement
Javadoc
org.springframework.beans.factory.FactoryBean that bootstraps the specified JCA 1.7 javax.resource.s

pi.ResourceAdapter, starting it with a local javax.resource.spi.BootstrapContext and exposing it for bean references. It will also stop the ResourceAdapter on context shutdown. This corresponds to 'non-managed' bootstrap in a local environment, according to the JCA 1.7 specification.

This is essentially an adapter for bean-style bootstrapping of a JCA ResourceAdapter, allowing the BootstrapContext or its elements (such as the JCA WorkManager) to be specified through bean properties. @author Juergen Hoeller @since 2.0.3 @see #setResourceAdapter @see #setBootstrapContext @see #setWorkManager @see javax.resource.spi.ResourceAdapter#start(javax.resource.spi.BootstrapContext) @see javax.resource.spi.ResourceAdapter#stop()

Read More
Advertisement