congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
javax.resource.spi
Code IndexAdd Tabnine to your IDE (free)

How to use javax.resource.spi

Best Java code snippets using javax.resource.spi (Showing top 20 results out of 360)

origin: spring-projects/spring-framework

/**
 * Stops the ResourceAdapter.
 * @see javax.resource.spi.ResourceAdapter#stop()
 */
@Override
public void destroy() {
  if (this.resourceAdapter != null) {
    this.resourceAdapter.stop();
  }
}
origin: spring-projects/spring-framework

@Override
public void afterPropertiesSet() throws ResourceException {
  if (this.managedConnectionFactory == null) {
    throw new IllegalArgumentException("Property 'managedConnectionFactory' is required");
  }
  if (this.connectionManager != null) {
    this.connectionFactory = this.managedConnectionFactory.createConnectionFactory(this.connectionManager);
  }
  else {
    this.connectionFactory = this.managedConnectionFactory.createConnectionFactory();
  }
}
origin: spring-projects/spring-framework

/**
 * 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();
}
origin: spring-projects/spring-framework

/**
 * Prepares the message endpoint, and automatically activates it
 * if the "autoStartup" flag is set to "true".
 */
@Override
public void afterPropertiesSet() throws ResourceException {
  if (getResourceAdapter() == null) {
    throw new IllegalArgumentException("Property 'resourceAdapter' is required");
  }
  if (getMessageEndpointFactory() == null) {
    throw new IllegalArgumentException("Property 'messageEndpointFactory' is required");
  }
  ActivationSpec activationSpec = getActivationSpec();
  if (activationSpec == null) {
    throw new IllegalArgumentException("Property 'activationSpec' is required");
  }
  if (activationSpec.getResourceAdapter() == null) {
    activationSpec.setResourceAdapter(getResourceAdapter());
  }
  else if (activationSpec.getResourceAdapter() != getResourceAdapter()) {
    throw new IllegalArgumentException("ActivationSpec [" + activationSpec +
        "] is associated with a different ResourceAdapter: " + activationSpec.getResourceAdapter());
  }
}
origin: spring-projects/spring-framework

/**
 * Deactivates the configured message endpoint.
 */
@Override
public void stop() {
  synchronized (this.lifecycleMonitor) {
    if (this.running) {
      ResourceAdapter resourceAdapter = getResourceAdapter();
      Assert.state(resourceAdapter != null, "No ResourceAdapter set");
      resourceAdapter.endpointDeactivation(getMessageEndpointFactory(), getActivationSpec());
      this.running = false;
    }
  }
}
origin: wildfly/wildfly

@Override
public Xid[] recover(int flag) throws XAException {
  return contextXATerminator.recover(flag);
}
origin: spring-projects/spring-framework

/**
 * Activates the configured message endpoint.
 */
@Override
public void start() {
  synchronized (this.lifecycleMonitor) {
    if (!this.running) {
      ResourceAdapter resourceAdapter = getResourceAdapter();
      Assert.state(resourceAdapter != null, "No ResourceAdapter set");
      try {
        resourceAdapter.endpointActivation(getMessageEndpointFactory(), getActivationSpec());
      }
      catch (ResourceException ex) {
        throw new IllegalStateException("Could not activate message endpoint", ex);
      }
      this.running = true;
    }
  }
}
origin: spring-projects/spring-framework

/**
 * Builds the BootstrapContext and starts the ResourceAdapter with it.
 * @see javax.resource.spi.ResourceAdapter#start(javax.resource.spi.BootstrapContext)
 */
@Override
public void afterPropertiesSet() throws ResourceException {
  if (this.resourceAdapter == null) {
    throw new IllegalArgumentException("'resourceAdapter' or 'resourceAdapterClass' is required");
  }
  if (this.bootstrapContext == null) {
    this.bootstrapContext = new SimpleBootstrapContext(this.workManager, this.xaTerminator);
  }
  this.resourceAdapter.start(this.bootstrapContext);
}
origin: wildfly/wildfly

@Override
public void commit(Xid xid, boolean onePhase) throws XAException {
  contextXATerminator.commit(xid, onePhase);
}
origin: wildfly/wildfly

  public void forget(final Xid xid) throws XAException {
    xaTerminator.forget(xid);
  }
};
origin: wildfly/wildfly

@Override
public int prepare(Xid xid) throws XAException {
  return contextXATerminator.prepare(xid);
}
origin: wildfly/wildfly

@Override
public void rollback(Xid xid) throws XAException {
  contextXATerminator.rollback(xid);
}
origin: org.springframework/spring-tx

@Override
public void afterPropertiesSet() throws ResourceException {
  if (this.managedConnectionFactory == null) {
    throw new IllegalArgumentException("Property 'managedConnectionFactory' is required");
  }
  if (this.connectionManager != null) {
    this.connectionFactory = this.managedConnectionFactory.createConnectionFactory(this.connectionManager);
  }
  else {
    this.connectionFactory = this.managedConnectionFactory.createConnectionFactory();
  }
}
origin: org.springframework/spring-tx

/**
 * 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();
}
origin: org.springframework/spring-tx

/**
 * Stops the ResourceAdapter.
 * @see javax.resource.spi.ResourceAdapter#stop()
 */
@Override
public void destroy() {
  if (this.resourceAdapter != null) {
    this.resourceAdapter.stop();
  }
}
origin: wildfly/wildfly

public Xid[] recover(final int flag, final String parentName) throws XAException {
  return xaTerminator.recover(flag);
}
origin: wildfly/wildfly

public void commit(final Xid xid, final boolean onePhase) throws XAException {
  xaTerminator.commit(xid, onePhase);
}
origin: wildfly/wildfly

@Override
public void forget(Xid xid) throws XAException {
  contextXATerminator.forget(xid);
}
origin: spring-projects/spring-framework

@Test
public void testCreatesManagedConnectionFactoryIfAConnectionManagerHasBeenConfigured() throws Exception {
  ManagedConnectionFactory managedConnectionFactory = mock(ManagedConnectionFactory.class);
  ConnectionManager connectionManager = mock(ConnectionManager.class);
  LocalConnectionFactoryBean factory = new LocalConnectionFactoryBean();
  factory.setManagedConnectionFactory(managedConnectionFactory);
  factory.setConnectionManager(connectionManager);
  factory.afterPropertiesSet();
  verify(managedConnectionFactory).createConnectionFactory(connectionManager);
}
origin: spring-projects/spring-framework

@Test
public void testCreatesVanillaConnectionFactoryIfNoConnectionManagerHasBeenConfigured() throws Exception {
  final Object CONNECTION_FACTORY = new Object();
  ManagedConnectionFactory managedConnectionFactory = mock(ManagedConnectionFactory.class);
  given(managedConnectionFactory.createConnectionFactory()).willReturn(CONNECTION_FACTORY);
  LocalConnectionFactoryBean factory = new LocalConnectionFactoryBean();
  factory.setManagedConnectionFactory(managedConnectionFactory);
  factory.afterPropertiesSet();
  assertEquals(CONNECTION_FACTORY, factory.getObject());
}
javax.resource.spi

Most used classes

  • ConnectionEvent
    The ConnectionEvent class provides information about the source of a connection related event.A Conn
  • ConnectionManager
    The ConnectionManager interface provides the hook which allows a resource adapter to pass a connecti
  • ManagedConnectionFactory
    ManagedConnectionFactory instance is a factory of both ManagedConnection and EIS-specific connection
  • ConnectionEventListener
    The ConnectionEventListener interface provides for a callback mechanism to enable objects to listen
  • WorkException
    A common base class for all Work processing related exceptions.
  • ManagedConnection,
  • MessageEndpointFactory,
  • WorkCompletedException,
  • BootstrapContext,
  • InvalidPropertyException,
  • MessageEndpoint,
  • ResourceAdapter,
  • ConfigProperty,
  • ResourceAdapterInternalException,
  • Connector,
  • Work,
  • WorkEvent,
  • ConnectionDefinition,
  • Activation
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now