public void start(BootstrapContext aCtx) throws ResourceAdapterInternalException { LOG.fine("Resource Adapter is starting by appserver..."); if (aCtx == null) { throw new ResourceAdapterInternalException("BootstrapContext can not be null"); } this.ctx = aCtx; }
String i18nMsg = localStrings.getString("rardeployment.start_failed", ex.getMessage()); ConnectorRuntimeException cre = new ConnectorRuntimeException(i18nMsg); cre.initCause(ex);
protected void closePhysicalConnection() throws ResourceException { Connection c = (Connection) physicalConnection; try { c.close(); } catch (SQLException e) { throw new ResourceAdapterInternalException("Error attempting to destroy managed connection", e); } }
public void setLogWriter(PrintWriter log) throws ResourceException { try { connectionPoolDataSource.setLogWriter(log); } catch (SQLException e) { throw new ResourceAdapterInternalException(e.getMessage(), e); } }
protected void closePhysicalConnection() throws ResourceException { try { xaConnection.close(); } catch (SQLException e) { throw new ResourceAdapterInternalException("Error attempting to destroy managed connection", e); } }
public PrintWriter getLogWriter() throws ResourceException { try { return dataSource.getLogWriter(); } catch (SQLException e) { throw new ResourceAdapterInternalException(e.getMessage(), e); } }
public void setLogWriter(PrintWriter log) throws ResourceException { try { dataSource.setLogWriter(log); } catch (SQLException e) { throw new ResourceAdapterInternalException(e.getMessage(), e); } }
public void setLogWriter(PrintWriter log) throws ResourceException { try { xaDataSource.setLogWriter(log); } catch (SQLException e) { throw new ResourceAdapterInternalException(e.getMessage(), e); } }
@Override public void start(BootstrapContext ctx) throws ResourceAdapterInternalException { LOGGER.info("Amazon SQS Resource Adapter Started.."); context = ctx; try { poller = context.createTimer(); } catch (UnavailableException ex) { LOGGER.log(Level.SEVERE, "Unable to create Poller", ex); throw new ResourceAdapterInternalException(ex); } }
public PrintWriter getLogWriter() throws ResourceException { try { return connectionPoolDataSource.getLogWriter(); } catch (SQLException e) { throw new ResourceAdapterInternalException(e.getMessage(), e); } }
protected void closePhysicalConnection() throws ResourceException { try { pooledConnection.close(); } catch (SQLException e) { throw new ResourceAdapterInternalException("Error attempting to destroy managed connection", e); } }
public PrintWriter getLogWriter() throws ResourceException { try { return xaDataSource.getLogWriter(); } catch (SQLException e) { throw new ResourceAdapterInternalException(e.getMessage(), e); } }
@Override public void start(BootstrapContext ctx) throws ResourceAdapterInternalException { LOGGER.info("Kafka Resource Adapter Started.."); context = ctx; try { poller = context.createTimer(); } catch (UnavailableException ex) { LOGGER.log(Level.SEVERE, "Unable to create Poller", ex); throw new ResourceAdapterInternalException(ex); } }
@Override public void start(BootstrapContext ctx) throws ResourceAdapterInternalException { if (workManager != null) throw new ResourceAdapterInternalException("Can only start once"); workManager = ctx.getWorkManager(); }
protected Connection getPhysicalConnection(Subject subject, CredentialExtractor credentialExtractor) throws ResourceException { try { return dataSource.getConnection(credentialExtractor.getUserName(), credentialExtractor.getPassword()); } catch (SQLException e) { throw new ResourceAdapterInternalException("Unable to obtain physical connection to " + dataSource, e); } }
public void start(BootstrapContext bootstrapContext) throws ResourceAdapterInternalException { try { SchedulerFactory factory = new StdSchedulerFactory(); scheduler = factory.getScheduler(); scheduler.start(); } catch (SchedulerException e) { throw new ResourceAdapterInternalException("Failed to create Quartz Scheduler", e); } }
protected void localTransactionRollback(boolean isSPI) throws ResourceException { Connection c = physicalConnection; try { c.rollback(); } catch (SQLException e) { throw new LocalTransactionException("Unable to rollback", e); } super.localTransactionRollback(isSPI); try { c.setAutoCommit(true); } catch (SQLException e) { throw new ResourceAdapterInternalException("Unable to enable autoCommit after rollback", e); } }
protected void localTransactionRollback(boolean isSPI) throws ResourceException { Connection c = physicalConnection; try { c.rollback(); } catch (SQLException e) { throw new LocalTransactionException("Unable to rollback", e); } super.localTransactionRollback(isSPI); try { c.setAutoCommit(true); } catch (SQLException e) { throw new ResourceAdapterInternalException("Unable to enable autoCommit after rollback", e); } }
protected void localTransactionRollback(boolean isSPI) throws ResourceException { Connection c = physicalConnection; try { c.rollback(); } catch (SQLException e) { throw new LocalTransactionException("Unable to rollback", e); } super.localTransactionRollback(isSPI); try { c.setAutoCommit(true); } catch (SQLException e) { throw new ResourceAdapterInternalException("Unable to enable autoCommit after rollback", e); } }
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException { this.workManager = ctx.getWorkManager(); for (int i = 0; this.workList != null && i < this.workList.size(); i++) { Work work = this.workList.get(i); try { this.workManager.startWork(work); } catch (WorkException ex) { this.stop(); throw new ResourceAdapterInternalException(ex); } catch (RuntimeException ex) { this.stop(); throw new ResourceAdapterInternalException(ex); } } }