@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public void activate ( ) throws InvalidStateException { if ( ! this . state . isInactive ( ) ) { throw new InvalidStateException ( "entity " + name + " is in state: " + this . state ) ; } this . state = ResourceAdaptorEntityState . ACTIVE ; // if slee is running then activate ra object if ( sleeContainer . getSleeState ( ) == SleeState . RUNNING ) { 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 ) ; } } }
Activates the ra entity