/** * Signals that the container is in STOPPING state * @throws TransactionRequiredLocalException */ public void sleeStopping() throws InvalidStateException, TransactionRequiredLocalException { if (state != null && state.isActive()) { try { object.raStopping(); } catch (Throwable t) { logger.error("Got exception from RA object",t); } scheduleAllActivitiesEnd(); } }
static public ResourceAdaptorEntityInfo toResourceAdaptorEntityInfo(String name, ResourceAdaptorEntityState state) throws ManagementConsoleException { String strState = ""; if (state.isActive()) strState = ResourceAdaptorEntityInfo.ACTIVE; else if (state.isInactive()) strState = ResourceAdaptorEntityInfo.INACTIVE; else if (state.isStopping()) strState = ResourceAdaptorEntityInfo.STOPPING; return new ResourceAdaptorEntityInfo(name, strState); }
/** * Signals that the container is in RUNNING state */ @SuppressWarnings({ "unchecked", "rawtypes" }) public void sleeRunning() throws InvalidStateException { // if entity is active then activate the ra object if (this.state.isActive()) { if (setFTContext) { setFTContext = false; if (object.isFaultTolerant()) { // set fault tolerant context, it is a ft ra try { this.ftResourceAdaptorContext = new FaultTolerantResourceAdaptorContextImpl(name,sleeContainer,(FaultTolerantResourceAdaptor) object.getResourceAdaptorObject()); object.setFaultTolerantResourceAdaptorContext(ftResourceAdaptorContext); } catch (Throwable t) { logger.error("Got exception invoking setFaultTolerantResourceAdaptorContext(...) for entity "+name, t); } } } try { object.raActive(); } catch (Throwable t) { logger.error("Got exception invoking raActive() for entity "+name, t); } } }
if (!this.state.isActive()) { throw new InvalidStateException("entity " + name + " is in state: " + this.state);