public void allActivitiesEnded() { logger.info("All activities ended for ra entity "+name); if (timerTask != null) { timerTask = null; } if (!this.state.isInactive()) { if (object.getState() == ResourceAdaptorObjectState.STOPPING) { try { object.raInactive(); } catch (Throwable t) { logger.error("Got exception invoking raInactive() for entity "+name, t); } } if (state != null && state.isStopping()) { state = ResourceAdaptorEntityState.INACTIVE; } } }
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); }
if (!this.state.isInactive()) { throw new InvalidStateException("entity " + name + " is in state: " + this.state);
/** * Removes the entity, it will unconfigure and unset the ra context, the * entity object can not be reused * * @throws InvalidStateException */ public void remove() throws InvalidStateException { if (!this.state.isInactive()) { throw new InvalidStateException("entity " + name + " is in state: " + this.state); } object.raUnconfigure(); if (object.isFaultTolerant()) { object.unsetFaultTolerantResourceAdaptorContext(); ftResourceAdaptorContext.shutdown(); } object.unsetResourceAdaptorContext(); this.sleeContainer.getTraceManagement() .deregisterNotificationSource(this.getNotificationSource()); state = null; }