throws ResourceException { if (!isActive) { throw new ResourceException( "JCAConnectionManagerImpl::allocateConnection::No valid Connection available"); } catch (PoolException ex) { throw new ResourceException( String.format( "JCAConnectionManagerImpl:: allocateConnection : in getting connection from pool due to %s", throw new ResourceException( String.format("JCAConnectionManagerImpl:: allocateConnection : in transaction due to %s", ex.getMessage()), ex); } catch (SystemException ex) { throw new ResourceException( String.format( "JCAConnectionManagerImpl:: allocateConnection :system exception due to %s",
throws ResourceException { if (!isActive) { throw new ResourceException( "FacetsJCAConnectionManagerImpl::allocateConnection::No valid Connection available"); } catch (PoolException ex) { ex.printStackTrace(); throw new ResourceException( String.format( "FacetsJCAConnectionManagerImpl:: allocateConnection : in getting connection from pool due to %s", "FacetsJCAConnectionManagerImpl:: An Exception was caught while allocating a connection due to %s", ex.getMessage()); throw new ResourceException(exception, ex); } catch (SystemException ex) { throw new ResourceException( String.format( "FacetsJCAConnectionManagerImpl:: allocateConnection :system exception due to %s",
public void associateConnection(Object connection) throws ResourceException { if (connection == null) { throw new ResourceException("Null connection handle"); } if (!(connection instanceof JcaExecutorServiceConnectionImpl)) { throw new ResourceException("Wrong connection handle"); } this.connection = (JcaExecutorServiceConnectionImpl) connection; }
public Object createConnectionFactory() throws ResourceException { throw new ResourceException("This resource adapter doesn't support non-managed environments"); }
public void endpointActivation(MessageEndpointFactory endpointFactory, ActivationSpec spec) throws ResourceException { if(jobHandlerActivation != null) { throw new ResourceException("The camunda BPM job executor can only service a single MessageEndpoint for job execution. " + "Make sure not to deploy more than one MDB implementing the '"+JobExecutionHandler.class.getName()+"' interface."); } JobExecutionHandlerActivation activation = new JobExecutionHandlerActivation(this, endpointFactory, (JobExecutionHandlerActivationSpec) spec); activation.start(); jobHandlerActivation = activation; }
/** * Accessor for Meta-Data. * @return The Connection Meta-Data. * @exception javax.resource.ResourceException <description> **/ public ConnectionMetaData getMetaData() throws ResourceException { throw new ResourceException("Not Yet Implemented"); }
/** * A getter which will return the current local transaction or throw a new exception * if this endpoint has already been released. */ protected LocalTransaction getLocalTransaction() throws ResourceException { if (localTransaction == null) { throw new ResourceException("This endpoint has already been released via a call to release() you cannot deliver messages to me"); } return localTransaction; }
public DescribeSObjectResult[] getObjectMetaData(String... objectName) throws ResourceException { try { return partnerConnection.describeSObjects(objectName); } catch (InvalidSObjectFault e) { throw new ResourceException(e); } catch (UnexpectedErrorFault e) { throw new ResourceException(e); } catch (ConnectionException e) { throw new ResourceException(e); } }
public DescribeGlobalResult getObjects() throws ResourceException { try { return partnerConnection.describeGlobal(); } catch (UnexpectedErrorFault e) { throw new ResourceException(e); } catch (ConnectionException e) { throw new ResourceException(e); } }
public ManagedSessionImpl(ConnectionFactory factory, Destination destination) throws ResourceException { _destination = destination; try { _connection = factory.createConnection(); _session = _connection.createSession(false, 1); _producer = _session.createProducer(destination); } catch (Exception e) { throw new ResourceException(e); } }
public void destroy() throws ResourceException { try { _producer.close(); _session.close(); _connection.close(); } catch (Exception e) { throw new ResourceException(e); } } }
public ActiveMQConnectionFactory getDefaultActiveMQConnectionFactory() throws ResourceException { if (!configured.getAndSet(true)) { try { setup(); } catch (ActiveMQException e) { throw new ResourceException("Unable to create activation", e); } } return defaultActiveMQConnectionFactory; }
public void cleanup() throws ResourceException { super.cleanup(); Connection c = (Connection) physicalConnection; try { //TODO reset tx isolation level if (!c.getAutoCommit()) { c.setAutoCommit(true); } } catch (SQLException e) { throw new ResourceException("Could not reset autocommit when returning to pool", e); } }
@Override public void close() throws ResourceException { try { checkLive(); closeSession(); repository.closeSession(this); } catch (Exception cause) { throw new ResourceException(cause); } }
/** * {@inheritDoc} */ @Override public void rollback() throws ResourceException { try { resource.end(xid, XAResource.TMFAIL); resource.rollback(xid); } catch (XAException e) { throw new ResourceException(e.getMessage()); } }
@Override public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo cri) throws ResourceException { try { return new XADiskRemoteManagedConnection(serverAddress, serverPort, NativeXAFileSystem.getXAFileSystem(super.getInstanceId())); } catch (IOException ioe) { throw new ResourceException(ioe); } }
public static EISException createResourceException(Object[] args, int errorCode) { ResourceException resourceException = new ResourceException(ExceptionMessageGenerator.buildMessage(EISException.class, errorCode, args)); EISException exception = new EISException(resourceException); exception.setErrorCode(RESOURCE_EXCEPTION); exception.setInternalException(resourceException); return exception; }
public static EISException createResourceException(Object[] args, int errorCode) { ResourceException resourceException = new ResourceException(ExceptionMessageGenerator.buildMessage(EISException.class, errorCode, args)); EISException exception = new EISException(resourceException); exception.setErrorCode(RESOURCE_EXCEPTION); exception.setInternalException(resourceException); return exception; }
private String getDescriptor(String key) throws ResourceException { try { return mcf.getRepository().getDescriptor(key); } catch (RepositoryException e) { log("Failed to access the repository", e); ResourceException exception = new ResourceException( "Failed to access the repository: " + e.getMessage()); exception.initCause(e); throw exception; } }
@Override public void beforeDelivery(Method method) throws NoSuchMethodException, ResourceException { super.beforeDelivery(method); try { xaResource.start(xid, XAResource.TMNOFLAGS); } catch (XAException e) { throw new ResourceException(e.getMessage(), e); } }