idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
162,900
private LaunchArguments createLaunchArguments ( String [ ] args , Map < String , String > initProps ) { List < String > cmdArgs = processBatchFileArgs ( new ArrayList < String > ( Arrays . asList ( args ) ) ) ; return new LaunchArguments ( cmdArgs , initProps , isClient ( ) ) ; }
Return an instance of LaunchArguments .
162,901
protected ReturnCode handleActions ( BootstrapConfig bootProps , LaunchArguments launchArgs ) { ReturnCode rc = launchArgs . getRc ( ) ; switch ( rc ) { case OK : rc = new KernelBootstrap ( bootProps ) . go ( ) ; break ; case CREATE_ACTION : ServerLock . createServerLock ( bootProps ) ; boolean generatePass = launchArgs . getOption ( "no-password" ) == null ; rc = bootProps . generateServerEnv ( generatePass ) ; break ; case MESSAGE_ACTION : rc = showMessage ( launchArgs ) ; break ; case HELP_ACTION : rc = showHelp ( launchArgs ) ; break ; case VERSION_ACTION : KernelBootstrap . showVersion ( bootProps ) ; rc = ReturnCode . OK ; break ; case STOP_ACTION : rc = new com . ibm . ws . kernel . boot . internal . commands . ProcessControlHelper ( bootProps , launchArgs ) . stop ( ) ; break ; case STATUS_ACTION : rc = new com . ibm . ws . kernel . boot . internal . commands . ProcessControlHelper ( bootProps , launchArgs ) . status ( false ) ; break ; case STARTING_STATUS_ACTION : rc = new com . ibm . ws . kernel . boot . internal . commands . ProcessControlHelper ( bootProps , launchArgs ) . status ( true ) ; break ; case START_STATUS_ACTION : rc = new com . ibm . ws . kernel . boot . internal . commands . ProcessControlHelper ( bootProps , launchArgs ) . startStatus ( ) ; break ; case PACKAGE_ACTION : rc = new com . ibm . ws . kernel . boot . internal . commands . PackageCommand ( bootProps , launchArgs ) . doPackage ( ) ; break ; case PACKAGE_WLP_ACTION : rc = new com . ibm . ws . kernel . boot . internal . commands . PackageCommand ( bootProps , launchArgs ) . doPackageRuntimeOnly ( ) ; break ; case DUMP_ACTION : rc = new com . ibm . ws . kernel . boot . internal . commands . ProcessControlHelper ( bootProps , launchArgs ) . dump ( ) ; break ; case JAVADUMP_ACTION : rc = new com . ibm . ws . kernel . boot . internal . commands . ProcessControlHelper ( bootProps , launchArgs ) . dumpJava ( ) ; break ; case PAUSE_ACTION : rc = new com . ibm . ws . kernel . boot . internal . commands . ProcessControlHelper ( bootProps , launchArgs ) . pause ( ) ; break ; case RESUME_ACTION : rc = new com . ibm . ws . kernel . boot . internal . commands . ProcessControlHelper ( bootProps , launchArgs ) . resume ( ) ; break ; case LIST_ACTION : rc = new ListServerHelper ( bootProps , launchArgs ) . listServers ( ) ; break ; default : showHelp ( launchArgs ) ; rc = ReturnCode . BAD_ARGUMENT ; } return rc ; }
Handle the process action .
162,902
protected void findLocations ( BootstrapConfig bootProps , String processName ) { String userDirStr = getEnv ( BootstrapConstants . ENV_WLP_USER_DIR ) ; String serversDirStr = getEnv ( bootProps . getOutputDirectoryEnvName ( ) ) ; String logDirStr = getEnv ( BootstrapConstants . ENV_X_LOG_DIR ) ; if ( logDirStr == null ) logDirStr = getEnv ( BootstrapConstants . ENV_LOG_DIR ) ; String consoleLogFileStr = getEnv ( BootstrapConstants . ENV_X_LOG_FILE ) ; if ( consoleLogFileStr == null ) consoleLogFileStr = getEnv ( BootstrapConstants . ENV_LOG_FILE ) ; bootProps . findLocations ( processName , userDirStr , serversDirStr , logDirStr , consoleLogFileStr ) ; }
Find main locations
162,903
void send ( AbstractMessage aMessage , int priority ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "send" , new Object [ ] { this , aMessage , new Integer ( priority ) , "verboseMsg OUT : " + aMessage . toVerboseString ( ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) MPIOMsgDebug . debug ( tc , aMessage , priority ) ; try { connection . send ( aMessage , priority ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "send" , "Message accepted by Comms" ) ; } catch ( SIConnectionDroppedException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "send" , "Message refused by Comms: Connection Dropped" ) ; mpio . error ( connection , e ) ; } catch ( SIConnectionUnavailableException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "send" , "Message refused by Comms: Connection Unavailable" ) ; mpio . error ( connection , e ) ; } catch ( SIConnectionLostException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "send" , "Message refused by Comms: Connection Lost" ) ; mpio . error ( connection , e ) ; } catch ( MessageEncodeFailedException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "send" , "Message refused by Comms: Msg Encode Failed" ) ; mpio . error ( connection , e ) ; } catch ( MessageCopyFailedException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "send" , "Message refused by Comms: Msg Copy Failed" ) ; mpio . error ( connection , e ) ; } catch ( UnsupportedEncodingException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "send" , "Message refused by Comms: Msg Encoding Failed" ) ; mpio . error ( connection , e ) ; } catch ( IncorrectMessageTypeException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "send" , "Message refused by Comms: Incorrect Message Type" ) ; mpio . error ( connection , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "send" ) ; }
If comms has capacity then send the encoded message data . Otherwise throw the message away .
162,904
public ProtocolVersion getVersion ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getVersion" ) ; ProtocolVersion version = ProtocolVersion . UNKNOWN ; ConnectionMetaData connMetaData = connection . getMetaData ( ) ; if ( connMetaData != null ) version = connMetaData . getProtocolVersion ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getVersion" , version ) ; return version ; }
Retrieve the ProtocolVersion associated with this connection .
162,905
protected Object performInvocation ( Exchange exchange , final Object serviceObject , Method m , Object [ ] paramArray ) throws Exception { m = serviceObject . getClass ( ) . getMethod ( m . getName ( ) , m . getParameterTypes ( ) ) ; return super . performInvocation ( exchange , serviceObject , m , paramArray ) ; }
This invokes the target operation . We override this method to deal with the fact that the serviceObject is actually an EJB wrapper class . We need to get an equivalent method on the serviceObject class in order to invoke the target operation .
162,906
private String getUserAccessId ( String userName ) { try { SecurityService securityService = securityServiceRef . getService ( ) ; UserRegistryService userRegistryService = securityService . getUserRegistryService ( ) ; UserRegistry userRegistry = userRegistryService . getUserRegistry ( ) ; String realm = userRegistry . getRealm ( ) ; String uniqueId = userRegistry . getUniqueUserId ( userName ) ; return AccessIdUtil . createAccessId ( AccessIdUtil . TYPE_USER , realm , uniqueId ) ; } catch ( EntryNotFoundException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Caught exception getting the access id for " + userName + ": " + e ) ; } } catch ( RegistryException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Caught exception getting the access id for " + userName + ": " + e ) ; } } return null ; }
Get the access id for a user by performing a looking up in the user registry .
162,907
private String getGroupAccessId ( String groupName ) { try { SecurityService securityService = securityServiceRef . getService ( ) ; UserRegistryService userRegistryService = securityService . getUserRegistryService ( ) ; UserRegistry userRegistry = userRegistryService . getUserRegistry ( ) ; String realm = userRegistry . getRealm ( ) ; String groupUniqueId = userRegistry . getUniqueGroupId ( groupName ) ; return AccessIdUtil . createAccessId ( AccessIdUtil . TYPE_GROUP , realm , groupUniqueId ) ; } catch ( EntryNotFoundException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Caught exception getting the access id for " + groupName + ": " + e ) ; } } catch ( RegistryException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Caught exception getting the access id for " + groupName + ": " + e ) ; } } return null ; }
Get the access id for a group by performing a looking up in the user registry .
162,908
private Object getSavedState ( FacesContext facesContext ) { Object encodedState = facesContext . getExternalContext ( ) . getRequestParameterMap ( ) . get ( STANDARD_STATE_SAVING_PARAM ) ; if ( encodedState == null || ( ( ( String ) encodedState ) . length ( ) == 0 ) ) { return null ; } Object savedStateObject = _stateTokenProcessor . decode ( facesContext , ( String ) encodedState ) ; return savedStateObject ; }
Reconstructs the state from the javax . faces . ViewState request parameter .
162,909
public boolean isPostback ( FacesContext context ) { return context . getExternalContext ( ) . getRequestParameterMap ( ) . containsKey ( ResponseStateManager . VIEW_STATE_PARAM ) ; }
Checks if the current request is a postback
162,910
public void initialise ( Identifier rootId , boolean enableCache ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( cclass , "initialise" , new Object [ ] { rootId , new Boolean ( enableCache ) } ) ; switch ( rootId . getType ( ) ) { case Selector . UNKNOWN : case Selector . OBJECT : matchTree = new EqualityMatcher ( rootId ) ; break ; case Selector . STRING : case Selector . TOPIC : matchTree = new StringMatcher ( rootId ) ; break ; case Selector . BOOLEAN : matchTree = new BooleanMatcher ( rootId ) ; break ; default : matchTree = new NumericMatcher ( rootId ) ; break ; } if ( enableCache ) { this . rootId = rootId ; matchCache = new MatchCache ( MATCH_CACHE_INITIAL_CAPACITY ) ; matchCache . setRehashFilter ( this ) ; ( ( EqualityMatcher ) matchTree ) . setCacheing ( true ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "MatchSpaceImpl" , this ) ; }
Initialise a newly created MatchSpace
162,911
public synchronized void addTarget ( Conjunction conjunction , MatchTarget object ) throws MatchingException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "addTarget" , new Object [ ] { conjunction , object } ) ; if ( rootId != null ) { OrdinalPosition rootOrd = new OrdinalPosition ( 0 , 0 ) ; SimpleTest test = Factory . findTest ( rootOrd , conjunction ) ; if ( test != null && test . getKind ( ) == SimpleTest . EQ ) { CacheEntry e = getCacheEntry ( test . getValue ( ) , true ) ; e . exactGeneration ++ ; ContentMatcher exact = e . exactMatcher ; e . exactMatcher = exact = Factory . createMatcher ( rootOrd , conjunction , exact ) ; e . cachedResults = null ; try { exact . put ( conjunction , object , subExpr ) ; e . noResultCache |= exact . hasTests ( ) ; } catch ( RuntimeException exc ) { FFDC . processException ( this , cclass , "com.ibm.ws.sib.matchspace.impl.MatchSpaceImpl.addTarget" , exc , "1:303:1.44" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "addTarget" , e ) ; throw new MatchingException ( exc ) ; } finally { e . exactGeneration ++ ; } exactPuts ++ ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "addTarget" ) ; return ; } } matchTreeGeneration ++ ; try { matchTree . put ( conjunction , object , subExpr ) ; } catch ( RuntimeException e ) { FFDC . processException ( this , cclass , "com.ibm.ws.sib.matchspace.impl.MatchSpaceImpl.addTarget" , e , "1:333:1.44" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "addTarget" , e ) ; throw new MatchingException ( e ) ; } finally { matchTreeGeneration ++ ; } wildPuts ++ ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "addTarget" ) ; }
Adds a Conjunction to the space and associates a MatchTarget with it .
162,912
private CacheEntry getCacheEntry ( Object value , boolean create ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "getCacheEntry" , new Object [ ] { value , new Boolean ( create ) , matchCache } ) ; CacheEntry e = ( CacheEntry ) matchCache . get ( value ) ; if ( e == null ) { if ( create ) { e = new CacheEntry ( ) ; matchCache . put ( value , e ) ; cacheCreates ++ ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "getCacheEntry" , e ) ; return e ; }
Gets the appropriate CacheEntry for a value of the root Identifier
162,913
public boolean shouldRetain ( Object key , Object val ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "shouldRetain" , new Object [ ] { key , val } ) ; CacheEntry e = ( CacheEntry ) val ; if ( e . exactMatcher != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "shouldRetain" , Boolean . TRUE ) ; return true ; } cacheRemoves ++ ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "shouldRetain" , Boolean . FALSE ) ; return false ; }
entries that don t have an exactMatcher .
162,914
public void statistics ( PrintWriter wtr ) { int truePessimisticGets = pessimisticGets - puntsDueToCache ; wtr . println ( "Exact puts: " + exactPuts + ", Wildcard generation: " + matchTreeGeneration + ", Wildcard puts: " + wildPuts + ", Wildcard-Cache-hit gets: " + wildCacheHitGets + ", Wildcard-Cache-miss gets: " + wildCacheMissGets + ", Result-Cache-hit gets: " + resultCacheHitGets + ", Exact matches: " + exactMatches + ", Results cached: " + resultsCached + ", Removals:" + removals + ", Cache entries created:" + cacheCreates + ", Cache entries removed:" + cacheRemoves + ", Optimistic gets:" + optimisticGets + ", True Pessimistic gets:" + truePessimisticGets + ", Mutating gets:" + puntsDueToCache ) ; }
Only used when doing isolated performance testing of the MatchSpace .
162,915
public synchronized void clear ( Identifier rootId , boolean enableCache ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( this , cclass , "clear" ) ; matchTree = null ; matchTreeGeneration = 0 ; subExpr . clear ( ) ; initialise ( rootId , enableCache ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( this , cclass , "clear" ) ; }
Removes all objects from the MatchSpace resetting it to the as new condition .
162,916
public SICoreConnection getConnection ( ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getConnection" ) ; checkAlreadyClosed ( ) ; ConnectionProxy conn = getConnectionProxy ( ) ; conn . checkAlreadyClosed ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getConnection" , conn ) ; return conn ; }
Returns the SICoreConnection which created this Session .
162,917
protected void checkAlreadyClosed ( ) throws SISessionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "checkAlreadyClosed" ) ; if ( isClosed ( ) ) throw new SISessionUnavailableException ( nls . getFormattedMessage ( "SESSION_CLOSED_SICO1013" , null , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "checkAlreadyClosed" ) ; }
Helper method to check if this session is closed and throws the appropriate exception if it is .
162,918
public SIDestinationAddress getDestinationAddress ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getDestinationAddress" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getDestinationAddress" , destinationAddress ) ; return destinationAddress ; }
This method will return the destination address of the destination that this session is currently attached to .
162,919
public TrmClientBootstrapRequest createNewTrmClientBootstrapRequest ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmClientBootstrapRequest" ) ; TrmClientBootstrapRequest msg = null ; try { msg = new TrmClientBootstrapRequestImpl ( ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmClientBootstrapRequest" ) ; return msg ; }
Create a new empty TrmClientBootstrapRequest message
162,920
public TrmClientBootstrapReply createNewTrmClientBootstrapReply ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmClientBootstrapReply" ) ; TrmClientBootstrapReply msg = null ; try { msg = new TrmClientBootstrapReplyImpl ( ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmClientBootstrapReply" ) ; return msg ; }
Create a new empty TrmClientBootstrapReply message
162,921
public TrmClientAttachRequest createNewTrmClientAttachRequest ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmClientAttachRequest" ) ; TrmClientAttachRequest msg = null ; try { msg = new TrmClientAttachRequestImpl ( ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmClientAttachRequest" ) ; return msg ; }
Create a new empty TrmClientAttachRequest message
162,922
public TrmClientAttachRequest2 createNewTrmClientAttachRequest2 ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmClientAttachRequest2" ) ; TrmClientAttachRequest2 msg = null ; try { msg = new TrmClientAttachRequest2Impl ( ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmClientAttachRequest2" ) ; return msg ; }
Create a new empty TrmClientAttachRequest2 message
162,923
public TrmClientAttachReply createNewTrmClientAttachReply ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmClientAttachReply" ) ; TrmClientAttachReply msg = null ; try { msg = new TrmClientAttachReplyImpl ( ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmClientAttachReply" ) ; return msg ; }
Create a new empty TrmClientAttachReply message
162,924
public TrmMeConnectRequest createNewTrmMeConnectRequest ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmMeConnectRequest" ) ; TrmMeConnectRequest msg = null ; try { msg = new TrmMeConnectRequestImpl ( ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmMeConnectRequest" ) ; return msg ; }
Create a new empty TrmMeConnectRequest message
162,925
public TrmMeConnectReply createNewTrmMeConnectReply ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmMeConnectReply" ) ; TrmMeConnectReply msg = null ; try { msg = new TrmMeConnectReplyImpl ( ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmMeConnectReply" ) ; return msg ; }
Create a new empty TrmMeConnectReply message
162,926
public TrmMeLinkRequest createNewTrmMeLinkRequest ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmMeLinkRequest" ) ; TrmMeLinkRequest msg = null ; try { msg = new TrmMeLinkRequestImpl ( ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmMeLinkRequest" ) ; return msg ; }
Create a new empty TrmMeLinkRequest message
162,927
public TrmMeLinkReply createNewTrmMeLinkReply ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmMeLinkReply" ) ; TrmMeLinkReply msg = null ; try { msg = new TrmMeLinkReplyImpl ( ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmMeLinkReply" ) ; return msg ; }
Create a new empty TrmMeLinkReply message
162,928
public TrmMeBridgeRequest createNewTrmMeBridgeRequest ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmMeBridgeRequest" ) ; TrmMeBridgeRequest msg = null ; try { msg = new TrmMeBridgeRequestImpl ( ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmMeBridgeRequest" ) ; return msg ; }
Create a new empty TrmMeBridgeRequest message
162,929
public TrmMeBridgeReply createNewTrmMeBridgeReply ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmMeBridgeReply" ) ; TrmMeBridgeReply msg = null ; try { msg = new TrmMeBridgeReplyImpl ( ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmMeBridgeReply" ) ; return msg ; }
Create a new empty TrmMeBridgeReply message
162,930
public TrmMeBridgeBootstrapRequest createNewTrmMeBridgeBootstrapRequest ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmMeBridgeBootstrapRequest" ) ; TrmMeBridgeBootstrapRequest msg = null ; try { msg = new TrmMeBridgeBootstrapRequestImpl ( ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmMeBridgeBootstrapRequest" ) ; return msg ; }
Create a new empty TrmMeBridgeBootstrapRequest message
162,931
public TrmMeBridgeBootstrapReply createNewTrmMeBridgeBootstrapReply ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewTrmMeBridgeBootstrapReply" ) ; TrmMeBridgeBootstrapReply msg = null ; try { msg = new TrmMeBridgeBootstrapReplyImpl ( ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createNewTrmMeBridgeBootstrapReply" ) ; return msg ; }
Create a new empty TrmMeBridgeBootstrapReply message
162,932
public TrmFirstContactMessage createInboundTrmFirstContactMessage ( byte rawMessage [ ] , int offset , int length ) throws MessageDecodeFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createInboundTrmFirstContactMessage" , new Object [ ] { rawMessage , Integer . valueOf ( offset ) , Integer . valueOf ( length ) } ) ; JsMsgObject jmo = new JsMsgObject ( TrmFirstContactAccess . schema , rawMessage , offset , length ) ; TrmFirstContactMessage message = new TrmFirstContactMessageImpl ( jmo ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createInboundTrmFirstContactMessage" , message ) ; return message ; }
Create a TrmFirstContactMessage to represent an inbound message .
162,933
public TrmRouteData createTrmRouteData ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createTrmRouteData" ) ; TrmRouteData msg = null ; try { msg = new TrmRouteDataImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createTrmRouteData" ) ; return msg ; }
Create a TrmRouteData message
162,934
public void eventRestored ( ) throws SevereMessageStoreException { super . eventRestored ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "eventRestored" ) ; try { NonLockingCursor cursor = newNonLockingItemCursor ( null ) ; AbstractItem item = cursor . next ( ) ; while ( item != null ) { if ( item instanceof SchemaStoreItem ) { addToIndex ( ( SchemaStoreItem ) item ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "JSchema found in store: " + ( ( SchemaStoreItem ) item ) . getSchema ( ) . getID ( ) ) ; } item = cursor . next ( ) ; } } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "eventRestored" , "108" , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "eventRestored" ) ; }
the message store . We build the index of any currently stored items .
162,935
void addSchema ( JMFSchema schema , Transaction tran ) throws MessageStoreException { addItem ( new SchemaStoreItem ( schema ) , tran ) ; }
Add a new schema defintion to the store
162,936
JMFSchema findSchema ( long schemaId ) throws MessageStoreException { Long storeId = schemaIndex . get ( Long . valueOf ( schemaId ) ) ; if ( storeId != null ) { AbstractItem item = findById ( storeId . longValue ( ) ) ; return ( ( SchemaStoreItem ) item ) . getSchema ( ) ; } else throw new MessageStoreException ( "Schema not found in store: " + schemaId ) ; }
Restore a schema definition from the store
162,937
void addToIndex ( SchemaStoreItem item ) throws NotInMessageStore { schemaIndex . put ( item . getSchema ( ) . getLongID ( ) , Long . valueOf ( item . getID ( ) ) ) ; item . setStream ( this ) ; }
Add an item to our index
162,938
void removeFromIndex ( SchemaStoreItem item ) { schemaIndex . remove ( item . getSchema ( ) . getLongID ( ) ) ; item . setStream ( null ) ; }
Remove an item from our index
162,939
public synchronized WSPKCSInKeyStore insert ( String tokenType , String tokenlib , String tokenPwd , boolean askeystore , String keyStoreProvider ) throws Exception { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "insert" , new Object [ ] { tokenType , tokenlib , keyStoreProvider } ) ; WSPKCSInKeyStore pKS = insertedAlready ( tokenlib ) ; boolean already = false ; if ( pKS == null ) { pKS = new WSPKCSInKeyStore ( tokenlib , keyStoreProvider ) ; } else { already = true ; } if ( askeystore ) pKS . asKeyStore ( tokenType , tokenlib , tokenPwd ) ; else pKS . asTrustStore ( tokenType , tokenlib , tokenPwd ) ; if ( ! already ) theV . add ( pKS ) ; if ( tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "insert" ) ; } return pKS ; }
Insert a new keystore into the list .
162,940
private WSPKCSInKeyStore insertedAlready ( String tokenlib ) { WSPKCSInKeyStore pKS = null ; WSPKCSInKeyStore rc = null ; Enumeration < WSPKCSInKeyStore > e = theV . elements ( ) ; while ( null == rc && e . hasMoreElements ( ) ) { pKS = e . nextElement ( ) ; if ( tokenlib . equalsIgnoreCase ( pKS . getlibName_key ( ) ) ) { rc = pKS ; } else if ( tokenlib . equalsIgnoreCase ( pKS . getlibName_trust ( ) ) ) { rc = pKS ; } } return rc ; }
Lookup the keystore object that may exist in the list for the input token library value .
162,941
public InputStream openKeyStore ( String fileName ) throws MalformedURLException , IOException { InputStream fis = null ; URL urlFile = null ; File kfile = null ; try { kfile = new File ( fileName ) ; } catch ( NullPointerException e ) { throw new IOException ( ) ; } try { if ( kfile . exists ( ) ) { if ( kfile . length ( ) == 0 ) { throw new IOException ( fileName ) ; } urlFile = new URL ( "file:" + kfile . getCanonicalPath ( ) ) ; } else { try { urlFile = new URL ( fileName ) ; } catch ( MalformedURLException e ) { throw e ; } } } catch ( SecurityException e ) { throw new IOException ( fileName ) ; } try { fis = urlFile . openStream ( ) ; } catch ( IOException e ) { throw e ; } return fis ; }
Open the input filename as a stream .
162,942
private void addAlternateNamedFacesConfig ( Container moduleContainer , ArrayList < String > classList ) { try { WebApp webapp = moduleContainer . adapt ( WebApp . class ) ; if ( webapp == null ) { return ; } List < ParamValue > params = webapp . getContextParams ( ) ; String configNames = null ; for ( ParamValue param : params ) { if ( param . getName ( ) . equals ( FACES_CONFIG_NAMES ) ) { configNames = param . getValue ( ) ; break ; } } if ( configNames == null ) return ; StringTokenizer st = new StringTokenizer ( configNames , "," ) ; while ( st . hasMoreTokens ( ) ) { addConfigFileBeans ( moduleContainer . getEntry ( st . nextToken ( ) ) , classList ) ; } } catch ( UnableToAdaptException e ) { if ( log . isLoggable ( Level . FINE ) ) { log . logp ( Level . FINE , CLASS_NAME , "addAlternateNamedFacesConfig" , "failed to adapt conatiner to WebApp" , e ) ; } } }
Look at the web . xml for a context - param javax . faces . CONFIG_FILES and treat as a comma delimited list
162,943
public static QName getServiceQName ( ClassInfo classInfo , String seiClassName , String targetNamespace ) { AnnotationInfo annotationInfo = getAnnotationInfoFromClass ( classInfo , "Service QName" ) ; if ( annotationInfo == null ) { return null ; } return getQName ( classInfo , targetNamespace , annotationInfo . getValue ( JaxWsConstants . SERVICENAME_ATTRIBUTE ) . getStringValue ( ) , JaxWsConstants . SERVICENAME_ATTRIBUTE_SUFFIX ) ; }
Get serviceName s QName of Web Service
162,944
public static QName getPortQName ( ClassInfo classInfo , String seiClassName , String targetNamespace ) { AnnotationInfo annotationInfo = getAnnotationInfoFromClass ( classInfo , "Port QName" ) ; if ( annotationInfo == null ) { return null ; } boolean webServiceProviderAnnotation = isProvider ( classInfo ) ; String wsName = webServiceProviderAnnotation ? null : annotationInfo . getValue ( JaxWsConstants . NAME_ATTRIBUTE ) . getStringValue ( ) ; return getPortQName ( classInfo , targetNamespace , wsName , annotationInfo . getValue ( JaxWsConstants . PORTNAME_ATTRIBUTE ) . getStringValue ( ) , JaxWsConstants . PORTNAME_ATTRIBUTE_SUFFIX ) ; }
Get portName QName of Web Service
162,945
public static boolean isProvider ( ClassInfo classInfo ) { AnnotationInfo annotationInfo = classInfo . getAnnotation ( JaxWsConstants . WEB_SERVICE_ANNOTATION_NAME ) ; if ( annotationInfo == null ) { annotationInfo = classInfo . getAnnotation ( JaxWsConstants . WEB_SERVICE_PROVIDER_ANNOTATION_NAME ) ; if ( annotationInfo != null ) { return true ; } } return false ; }
Judge if is a Web Service Provider .
162,946
public static String getImplementedTargetNamespace ( ClassInfo classInfo ) { String defaultValue = getNamespace ( classInfo , null ) ; if ( StringUtils . isEmpty ( defaultValue ) ) { defaultValue = JaxWsConstants . UNKNOWN_NAMESPACE ; } AnnotationInfo annotationInfo = getAnnotationInfoFromClass ( classInfo , JaxWsConstants . TARGETNAMESPACE_ATTRIBUTE ) ; if ( annotationInfo == null ) { return "" ; } AnnotationValue attrValue = annotationInfo . getValue ( JaxWsConstants . TARGETNAMESPACE_ATTRIBUTE ) ; String attrFromAnnotation = attrValue == null ? null : attrValue . getStringValue ( ) . trim ( ) ; return StringUtils . isEmpty ( attrFromAnnotation ) ? defaultValue : attrFromAnnotation ; }
get the targetNamespace from implementation bean . if can get the targetNamespace attribute from annotation then return it otherwise return the package name as default value . Both webService and webServiceprovider has the same logic .
162,947
public static String getInterfaceTargetNamespace ( ClassInfo classInfo , String seiClassName , String implementedTargetNamespace , InfoStore infoStore ) { AnnotationInfo annotationInfo = getAnnotationInfoFromClass ( classInfo , JaxWsConstants . TARGETNAMESPACE_ATTRIBUTE ) ; if ( annotationInfo == null ) { return "" ; } boolean isProvider = isProvider ( classInfo ) ; if ( isProvider ) { AnnotationValue attrValue = annotationInfo . getValue ( JaxWsConstants . TARGETNAMESPACE_ATTRIBUTE ) ; String attrFromAnnotation = attrValue == null ? null : attrValue . getStringValue ( ) . trim ( ) ; return StringUtils . isEmpty ( attrFromAnnotation ) ? implementedTargetNamespace : attrFromAnnotation ; } if ( null == infoStore || StringUtils . isEmpty ( seiClassName ) ) { return implementedTargetNamespace ; } ClassInfo seiClassInfo = infoStore . getDelayableClassInfo ( seiClassName ) ; String defaultValue = getNamespace ( seiClassInfo , null ) ; if ( StringUtils . isEmpty ( defaultValue ) ) { defaultValue = JaxWsConstants . UNKNOWN_NAMESPACE ; } annotationInfo = seiClassInfo . getAnnotation ( JaxWsConstants . WEB_SERVICE_ANNOTATION_NAME ) ; if ( null == annotationInfo ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No @WebService or @WebServiceProvider annotation is found on the class " + seiClassInfo + " will return " + defaultValue ) ; } return defaultValue ; } String attrFromSEI = annotationInfo . getValue ( JaxWsConstants . TARGETNAMESPACE_ATTRIBUTE ) . getStringValue ( ) . trim ( ) ; return StringUtils . isEmpty ( attrFromSEI ) ? defaultValue : attrFromSEI ; }
get the targetNamespace from SEI . If it is webServiceProvider just return the targetNamespace attribute from annotation . If it is webService and no SEI specified return the implementedTargetNamespace ; If it is webService and SEI specified with no targetNamespace attribute should report error? If it is webService and SEI specified with targetNamespace attribute just return the targetNamespace attribute value .
162,948
public static String getWSDLLocation ( ClassInfo classInfo , String seiClassName , InfoStore infoStore ) { return getStringAttributeFromAnnotation ( classInfo , seiClassName , infoStore , JaxWsConstants . WSDLLOCATION_ATTRIBUTE , "" , "" ) ; }
First get the WSDL Location .
162,949
private static String getStringAttributeFromWebServiceProviderAnnotation ( AnnotationInfo annotationInfo , String attribute , String defaultForServiceProvider ) { if ( attribute . equals ( JaxWsConstants . ENDPOINTINTERFACE_ATTRIBUTE ) || attribute . equals ( JaxWsConstants . NAME_ATTRIBUTE ) ) { return defaultForServiceProvider ; } AnnotationValue attrValue = annotationInfo . getValue ( attribute ) ; String attrFromSP = attrValue == null ? null : attrValue . getStringValue ( ) . trim ( ) ; return StringUtils . isEmpty ( attrFromSP ) ? defaultForServiceProvider : attrFromSP ; }
Return the attribute value of WebServiceProvider annotation
162,950
private static String getStringAttributeFromAnnotation ( ClassInfo classInfo , String seiClassName , InfoStore infoStore , String attribute , String defaultForService , String defaultForServiceProvider ) { AnnotationInfo annotationInfo = getAnnotationInfoFromClass ( classInfo , attribute ) ; if ( annotationInfo == null ) { return "" ; } boolean isProvider = isProvider ( classInfo ) ; if ( isProvider ) { return getStringAttributeFromWebServiceProviderAnnotation ( annotationInfo , attribute , defaultForServiceProvider ) ; } String attrFromImplBean = annotationInfo . getValue ( attribute ) . getStringValue ( ) . trim ( ) ; if ( attrFromImplBean . isEmpty ( ) ) { if ( seiClassName . isEmpty ( ) ) { return defaultForService ; } else { ClassInfo seiClassInfo = infoStore . getDelayableClassInfo ( seiClassName ) ; annotationInfo = seiClassInfo . getAnnotation ( JaxWsConstants . WEB_SERVICE_ANNOTATION_NAME ) ; if ( null == annotationInfo ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No @WebService or @WebServiceProvider annotation is found on the class " + seiClassInfo + " will return " + defaultForService ) ; } return defaultForService ; } String attrFromSEI = annotationInfo . getValue ( attribute ) . getStringValue ( ) . trim ( ) ; return StringUtils . isEmpty ( attrFromSEI ) ? defaultForService : attrFromSEI ; } } return attrFromImplBean ; }
Get the string value of attribute in WebService or WebserviceProvider annotation .
162,951
public static String getPortComponentName ( ClassInfo classInfo , String seiClassName , InfoStore infoStore ) { String defaultForServiceProvider = classInfo . getName ( ) ; String defaultForService = getClassName ( classInfo . getName ( ) ) ; return getStringAttributeFromAnnotation ( classInfo , seiClassName , infoStore , JaxWsConstants . NAME_ATTRIBUTE , defaultForService , defaultForServiceProvider ) ; }
Get the portComponentName from ClassInfo
162,952
private static QName getPortQName ( ClassInfo classInfo , String namespace , String wsName , String wsPortName , String suffix ) { String portName ; if ( wsPortName != null && ! wsPortName . isEmpty ( ) ) { portName = wsPortName . trim ( ) ; } else { if ( wsName != null && ! wsName . isEmpty ( ) ) { portName = wsName . trim ( ) ; } else { String qualifiedName = classInfo . getQualifiedName ( ) ; int lastDotIndex = qualifiedName . lastIndexOf ( "." ) ; portName = ( lastDotIndex == - 1 ? qualifiedName : qualifiedName . substring ( lastDotIndex + 1 ) ) ; } portName = portName + suffix ; } return new QName ( namespace , portName ) ; }
Get portName . 1 . declared portName in web service annotation 2 . name in web service annotation + Port 3 . service class name + Port .
162,953
public static boolean matchesQName ( QName regQName , QName targetQName , boolean ignorePrefix ) { if ( regQName == null || targetQName == null ) { return false ; } if ( "*" . equals ( getQNameString ( regQName ) ) ) { return true ; } if ( ! ( regQName . getNamespaceURI ( ) . equals ( targetQName . getNamespaceURI ( ) ) ) || ! ( ignorePrefix || regQName . getPrefix ( ) . equals ( targetQName . getPrefix ( ) ) ) ) { return false ; } if ( regQName . getLocalPart ( ) . contains ( "*" ) ) { return Pattern . matches ( mapPattern ( regQName . getLocalPart ( ) ) , targetQName . getLocalPart ( ) ) ; } else if ( regQName . getLocalPart ( ) . equals ( targetQName . getLocalPart ( ) ) ) { return true ; } return false ; }
Check whether the regQName matches the targetQName
162,954
public static String getProtocolByToken ( String token , boolean returnDefault ) { if ( StringUtils . isEmpty ( token ) && returnDefault ) { return JaxWsConstants . SOAP11HTTP_BINDING ; } if ( JaxWsConstants . SOAP11_HTTP_TOKEN . equals ( token ) ) { return JaxWsConstants . SOAP11HTTP_BINDING ; } else if ( JaxWsConstants . SOAP11_HTTP_MTOM_TOKEN . equals ( token ) ) { return JaxWsConstants . SOAP11HTTP_MTOM_BINDING ; } else if ( JaxWsConstants . SOAP12_HTTP_TOKEN . equals ( token ) ) { return JaxWsConstants . SOAP12HTTP_BINDING ; } else if ( JaxWsConstants . SOAP12_HTTP_MTOM_TOKEN . equals ( token ) ) { return JaxWsConstants . SOAP12HTTP_MTOM_BINDING ; } else if ( JaxWsConstants . XML_HTTP_TOKEN . equals ( token ) ) { return JaxWsConstants . HTTP_BINDING ; } else { return token ; } }
Get the protocol by token
162,955
public boolean addSync ( ) throws ResourceException { if ( tc . isEntryEnabled ( ) ) { Tr . entry ( this , tc , "addSync" ) ; } UOWCoordinator uowCoord = mcWrapper . getUOWCoordinator ( ) ; if ( uowCoord == null ) { IllegalStateException e = new IllegalStateException ( "addSync: illegal state exception. uowCoord is null" ) ; Tr . error ( tc , "ILLEGAL_STATE_EXCEPTION_J2CA0079" , "addSync" , e ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "addSync" , e ) ; throw e ; } try { EmbeddableWebSphereTransactionManager tranMgr = mcWrapper . pm . connectorSvc . transactionManager ; tranMgr . registerSynchronization ( uowCoord , this ) ; final ManagedConnection mc = mcWrapper . getManagedConnection ( ) ; if ( mc instanceof WSManagedConnection ) { tranMgr . registerSynchronization ( uowCoord , new Synchronization ( ) { public void beforeCompletion ( ) { } public void afterCompletion ( int status ) { ( ( WSManagedConnection ) mc ) . afterCompletionRRS ( ) ; } } , RegisteredSyncs . SYNC_TIER_RRS ) ; } } catch ( Exception e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.ejs.j2c.RRSGlobalTransactionWrapper.addSync" , "238" , this ) ; Tr . error ( tc , "REGISTER_WITH_SYNCHRONIZATION_EXCP_J2CA0026" , "addSync" , e , "ResourceException" ) ; ResourceException re = new ResourceException ( "addSync: caught Exception" ) ; re . initCause ( e ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "addSync" , e ) ; throw re ; } if ( tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "addSync" , true ) ; } return true ; }
Register the RRSGlobalTransactionWrapper as a sync object with the Transaction Manager for the current transaction .
162,956
private void taskProperties ( RESTRequest request , RESTResponse response ) { String taskID = RESTHelper . getRequiredParam ( request , APIConstants . PARAM_TASK_ID ) ; String taskPropertiesText = getMultipleRoutingHelper ( ) . getTaskProperties ( taskID ) ; OutputHelper . writeTextOutput ( response , taskPropertiesText ) ; }
Returns the list of available properties and their corresponding URLs .
162,957
private void taskProperty ( RESTRequest request , RESTResponse response ) { String taskID = RESTHelper . getRequiredParam ( request , APIConstants . PARAM_TASK_ID ) ; String property = RESTHelper . getRequiredParam ( request , APIConstants . PARAM_PROPERTY ) ; String taskPropertyText = getMultipleRoutingHelper ( ) . getTaskProperty ( taskID , property ) ; OutputHelper . writeTextOutput ( response , taskPropertyText ) ; }
Returns the value of the property . An IllegalArgument exception is thrown if the value is not an instance of java . lang . String .
162,958
public static DERUTF8String getInstance ( Object obj ) { if ( obj == null || obj instanceof DERUTF8String ) { return ( DERUTF8String ) obj ; } if ( obj instanceof ASN1OctetString ) { return new DERUTF8String ( ( ( ASN1OctetString ) obj ) . getOctets ( ) ) ; } if ( obj instanceof ASN1TaggedObject ) { return getInstance ( ( ( ASN1TaggedObject ) obj ) . getObject ( ) ) ; } throw new IllegalArgumentException ( "illegal object in getInstance: " + obj . getClass ( ) . getName ( ) ) ; }
return an UTF8 string from the passed in object .
162,959
public static JsMessagingEngine [ ] registerMessagingEngineListener ( final SibRaMessagingEngineListener listener , final String busName ) { final String methodName = "registerMessagingEngineListener" ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( TRACE , methodName , new Object [ ] { listener , busName } ) ; } final Set activeMessagingEngines = new HashSet ( ) ; synchronized ( ACTIVE_MESSAGING_ENGINES ) { synchronized ( MESSAGING_ENGINE_LISTENERS ) { Set listeners = ( Set ) MESSAGING_ENGINE_LISTENERS . get ( busName ) ; if ( listeners == null ) { listeners = new HashSet ( ) ; MESSAGING_ENGINE_LISTENERS . put ( busName , listeners ) ; } listeners . add ( listener ) ; } if ( busName == null ) { for ( final Iterator iterator = ACTIVE_MESSAGING_ENGINES . values ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { final Set messagingEngines = ( Set ) iterator . next ( ) ; activeMessagingEngines . addAll ( messagingEngines ) ; } } else { final Set messagingEngines = ( Set ) ACTIVE_MESSAGING_ENGINES . get ( busName ) ; if ( messagingEngines != null ) { activeMessagingEngines . addAll ( messagingEngines ) ; } } } final JsMessagingEngine [ ] result = ( JsMessagingEngine [ ] ) activeMessagingEngines . toArray ( new JsMessagingEngine [ activeMessagingEngines . size ( ) ] ) ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( TRACE , methodName , result ) ; } return result ; }
Registers a listener for active messaging engines on a bus .
162,960
public static void deregisterMessagingEngineListener ( final SibRaMessagingEngineListener listener , final String busName ) { final String methodName = "deregisterMessagingEngineListener" ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( TRACE , methodName , new Object [ ] { listener , busName } ) ; } synchronized ( MESSAGING_ENGINE_LISTENERS ) { final Set listeners = ( Set ) MESSAGING_ENGINE_LISTENERS . get ( busName ) ; if ( listeners != null ) { listeners . remove ( listener ) ; if ( listeners . isEmpty ( ) ) { MESSAGING_ENGINE_LISTENERS . remove ( busName ) ; } } } if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( TRACE , methodName ) ; } }
Deregisters a listener for active messaging engines on a bus .
162,961
public static JsMessagingEngine [ ] getMessagingEngines ( final String busName ) { final String methodName = "getMessagingEngines" ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( TRACE , methodName , busName ) ; } final JsMessagingEngine [ ] result ; synchronized ( MESSAGING_ENGINES ) { final Set messagingEngines = ( Set ) MESSAGING_ENGINES . get ( busName ) ; if ( messagingEngines == null ) { result = new JsMessagingEngine [ 0 ] ; } else { result = ( JsMessagingEngine [ ] ) messagingEngines . toArray ( new JsMessagingEngine [ messagingEngines . size ( ) ] ) ; } } if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( TRACE , methodName , result ) ; } return result ; }
Returns an array of initialized messaging engines for the given bus . If there are none an empty array is returned .
162,962
public void engineReloaded ( Object objectSent ) { final JsMessagingEngine engine = ( JsMessagingEngine ) objectSent ; final String methodName = "engineReloaded" ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , engine ) ; } RELOADING_MESSAGING_ENGINES . remove ( engine . getUuid ( ) . toString ( ) ) ; final Set listeners = getListeners ( engine . getBusName ( ) ) ; for ( final Iterator iterator = listeners . iterator ( ) ; iterator . hasNext ( ) ; ) { final SibRaMessagingEngineListener listener = ( SibRaMessagingEngineListener ) iterator . next ( ) ; listener . messagingEngineReloaded ( engine ) ; } if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
lohith liberty change
162,963
private static Set getListeners ( final String busName ) { final String methodName = "getListeners" ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( TRACE , methodName , busName ) ; } final Set listeners = new HashSet ( ) ; synchronized ( MESSAGING_ENGINE_LISTENERS ) { final Set busListeners = ( Set ) MESSAGING_ENGINE_LISTENERS . get ( busName ) ; if ( busListeners != null ) { listeners . addAll ( busListeners ) ; } final Set noBusListeners = ( Set ) MESSAGING_ENGINE_LISTENERS . get ( null ) ; if ( noBusListeners != null ) { listeners . addAll ( noBusListeners ) ; } } if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( TRACE , methodName , listeners ) ; } return listeners ; }
Returns the set of listeners for the given bus .
162,964
private static boolean isTruePartitionOfTopLevelStep ( Step step ) { Partition partition = step . getPartition ( ) ; if ( partition . getMapper ( ) != null ) { if ( logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , CLASSNAME , "validatePartition" , "Found partitioned step with mapper" , step ) ; } return true ; } else if ( partition . getPlan ( ) != null ) { if ( partition . getPlan ( ) . getPartitions ( ) != null ) { if ( logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , CLASSNAME , "validatePartition" , "Found partitioned step with plan" , step ) ; } return true ; } else { if ( logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , CLASSNAME , "validatePartition" , "Found plan with partitions stripped out. Must be a partition on the partition work unit thread" , step ) ; } return false ; } } else { throw new IllegalArgumentException ( "Partition does not contain either a mapper or a plan. Aborting." ) ; } }
Need to perform this check because of the way we manipulate the model in building our subjob for the partition .
162,965
protected ClassConfigData processClassConfiguration ( final InputStream inputStream ) throws IOException { if ( introspectAnnotations == false ) { return new ClassConfigData ( inputStream ) ; } ClassReader cr = new ClassReader ( inputStream ) ; ClassWriter cw = new ClassWriter ( cr , 0 ) ; TraceConfigClassVisitor cv = new TraceConfigClassVisitor ( cw ) ; cr . accept ( cv , 0 ) ; ClassInfo classInfo = cv . getClassInfo ( ) ; InputStream classInputStream = new ByteArrayInputStream ( cw . toByteArray ( ) ) ; return new ClassConfigData ( classInputStream , classInfo ) ; }
Introspect configuration information from the class in the provided InputStream .
162,966
protected ClassInfo mergeClassConfigInfo ( ClassInfo classInfo ) { PackageInfo packageInfo = configFileParser . getPackageInfo ( classInfo . getInternalPackageName ( ) ) ; if ( packageInfo == null ) { packageInfo = getPackageInfo ( classInfo . getInternalPackageName ( ) ) ; } classInfo . updateDefaultValuesFromPackageInfo ( packageInfo ) ; ClassInfo ci = configFileParser . getClassInfo ( classInfo . getInternalClassName ( ) ) ; if ( ci != null ) { classInfo . overrideValuesFromExplicitClassInfo ( ci ) ; } return classInfo ; }
Attempt to normalize the various levels of configuration information prior to instrumenting a class .
162,967
private static void printUsageMessage ( ) { System . out . println ( "Description:" ) ; System . out . println ( " StaticTraceInstrumentation can modify classes" ) ; System . out . println ( " in place to add calls to a trace framework that will" ) ; System . out . println ( " delegate to JSR47 logging or WebSphere Tr." ) ; System . out . println ( "" ) ; System . out . println ( "Required arguments:" ) ; System . out . println ( " The paths to one or more binary classes, jars, or" ) ; System . out . println ( " directories to scan for classes and jars are required" ) ; System . out . println ( " parameters." ) ; System . out . println ( "" ) ; System . out . println ( " Class files must have a .class extension." ) ; System . out . println ( " Jar files must have a .jar or a .zip extension." ) ; System . out . println ( " Directories are recursively scanned for .jar, .zip, and" ) ; System . out . println ( " .class files to instrument." ) ; }
Gentle usage message that needs to be written .
162,968
public static LibertyVersionRange valueOf ( String versionRangeString ) { if ( versionRangeString == null ) { return null ; } Matcher versionRangeMatcher = VERSION_RANGE_PATTERN . matcher ( versionRangeString ) ; if ( versionRangeMatcher . matches ( ) ) { LibertyVersion minVersion = LibertyVersion . valueOf ( versionRangeMatcher . group ( 1 ) ) ; LibertyVersion maxVersion = LibertyVersion . valueOf ( versionRangeMatcher . group ( 2 ) ) ; if ( minVersion != null && maxVersion != null ) { return new LibertyVersionRange ( minVersion , maxVersion ) ; } else { return null ; } } else { LibertyVersion minVersion = LibertyVersion . valueOf ( versionRangeString ) ; if ( minVersion != null ) { return new LibertyVersionRange ( minVersion , null ) ; } else { return null ; } } }
Attempts to parse the supplied version range string into a Liberty version range containing just numbers . If it fails to do so it will return null .
162,969
protected void detach ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "detach" ) ; getCursor . finished ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "detach" ) ; }
Detach processing for this filter
162,970
protected void discard ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "discard" ) ; if ( getCursor != null ) { getCursor . finished ( ) ; getCursor = null ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "discard" ) ; }
Discard processing for this filter
162,971
public void registerInterceptors ( EjbDescriptor < ? > ejbDescriptor , InterceptorBindings interceptorBindings ) { if ( interceptorBindings != null ) { final Collection < Interceptor < ? > > interceptors = interceptorBindings . getAllInterceptors ( ) ; if ( interceptors != null ) { for ( Interceptor < ? > interceptor : interceptors ) { final Set < Annotation > annotations = interceptor . getInterceptorBindings ( ) ; if ( annotations != null ) { for ( Annotation annotation : annotations ) { if ( Transactional . class . equals ( annotation . annotationType ( ) ) ) { throw new IllegalStateException ( Tr . formatMessage ( tc , "transactional.annotation.on.ejb.CWOWB2000E" , annotation . toString ( ) , ejbDescriptor . getEjbName ( ) ) ) ; } } } } EjbDescriptor < ? > descriptor = ejbDescriptor ; WebSphereEjbDescriptor < ? > webSphereEjbDescriptor = findWebSphereEjbDescriptor ( descriptor ) ; J2EEName ejbJ2EEName = webSphereEjbDescriptor . getEjbJ2EEName ( ) ; interceptorRegistry . registerInterceptors ( ejbJ2EEName , interceptorBindings ) ; } } }
Throw an exception if an interceptor for Transactional is registered
162,972
protected void updateSubjectWithTemporarySubjectContents ( ) { subject . getPrincipals ( ) . addAll ( temporarySubject . getPrincipals ( ) ) ; subject . getPublicCredentials ( ) . addAll ( temporarySubject . getPublicCredentials ( ) ) ; subject . getPrivateCredentials ( ) . addAll ( temporarySubject . getPrivateCredentials ( ) ) ; }
Sets the subject with the temporary subject contents that was not set already from the shared state .
162,973
public int size ( boolean includeDiskCache ) { int mappings = 0 ; mappings = cache . getNumberCacheEntries ( ) ; if ( includeDiskCache ) { if ( cache instanceof CacheProviderWrapper ) { CacheProviderWrapper cpw = ( CacheProviderWrapper ) cache ; if ( cpw . featureSupport . isDiskCacheSupported ( ) ) mappings = mappings + cache . getIdsSizeDisk ( ) ; } else { mappings = mappings + cache . getIdsSizeDisk ( ) ; } } return mappings ; }
Returns number of key - value mappings in this map .
162,974
public void addAlias ( Object key , Object [ ] aliasArray ) { final String methodName = "addAlias(key, aliasArray)" ; functionNotAvailable ( methodName ) ; }
Adds one or more aliases for the given key in the cache s mapping table . If the alias is already associated with another key it will be changed to associate with the new key .
162,975
public void invalidate ( Object key , boolean wait , boolean checkPreInvalidationListener ) { final String methodName = "invalidate(key, wait, checkPreInvalidationListener)" ; functionNotAvailable ( methodName ) ; }
invalidate - invalidates the given key . If the key is for a specific cache entry then only that object is invalidated . If the key is for a dependency id then all objects that share that dependency id will be invalidated .
162,976
public void setWsLogHandler ( String id , WsLogHandler ref ) { if ( id != null && ref != null ) { RERWLOCK . writeLock ( ) . lock ( ) ; try { wsLogHandlerServices . put ( id , ref ) ; if ( earlierMessages == null ) { return ; } for ( RoutedMessage earlierMessage : earlierMessages . toArray ( new RoutedMessage [ earlierMessages . size ( ) ] ) ) { if ( shouldRouteMessageToLogHandler ( earlierMessage , id ) ) { routeTo ( earlierMessage , id ) ; } } } finally { RERWLOCK . writeLock ( ) . unlock ( ) ; } } }
Add the WsLogHandler ref . 1 or more LogHandlers may be set .
162,977
public long getByteBufferAddress ( ByteBuffer byteBuffer ) { if ( ! byteBuffer . isDirect ( ) ) { throw new IllegalArgumentException ( "The specified byte buffer is not direct" ) ; } try { return svAddrField . getLong ( byteBuffer ) ; } catch ( IllegalAccessException exception ) { throw new RuntimeException ( exception . getMessage ( ) ) ; } }
Get the native address for the specified DirectByteBuffer
162,978
public long getSocketChannelHandle ( SocketChannel socketChannel ) { StartPrivilegedThread privThread = new StartPrivilegedThread ( socketChannel ) ; return AccessController . doPrivileged ( privThread ) ; }
Get the socket channel handle .
162,979
public void cleanThreadLocals ( Thread thread ) { try { svThreadLocalsField . set ( thread , null ) ; } catch ( IllegalAccessException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Unable to clear java.lang.ThreadLocals: " , e ) ; } }
Clean up the thread locals for the specified Thread .
162,980
private boolean hasConfigChanged ( Document newConfig ) { NodeList list = newConfig . getElementsByTagName ( "*" ) ; int currentHash = nodeListHashValue ( list ) ; if ( this . previousConfigHash == null || currentHash != this . previousConfigHash ) { this . previousConfigHash = currentHash ; return true ; } else { return false ; } }
Check to see if the current config has the same information as the previously written config . If this config has no new information return false .
162,981
public URLConnection openConnection ( URL url ) throws IOException { String path = url . getPath ( ) ; int resourceDelimiterIndex = path . indexOf ( "!/" ) ; URLConnection conn ; if ( resourceDelimiterIndex == - 1 ) { conn = Utils . newURL ( path ) . openConnection ( ) ; } else { String urlString = ParserUtils . decode ( path . substring ( 0 , resourceDelimiterIndex ) ) ; String entry = ParserUtils . decode ( path . substring ( resourceDelimiterIndex + 2 ) ) ; URL jarURL = constructUNCTolerantURL ( "file" , urlString ) ; conn = new WSJarURLConnectionImpl ( url , jarURL . getPath ( ) , entry , zipCache ) ; } return conn ; }
begin 408408 . 2
162,982
public void reconstitute ( int startMode , HashMap < String , Object > durableSubscriptionsTable ) throws SIIncorrectCallException , SIDiscriminatorSyntaxException , SISelectorSyntaxException , MessageStoreException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reconstitute" , new Object [ ] { new Integer ( startMode ) , durableSubscriptionsTable } ) ; initialise ( false , durableSubscriptionsTable ) ; NonLockingCursor cursor = _baseDestinationHandler . newNonLockingItemStreamCursor ( new ClassEqualsFilter ( PubSubMessageItemStream . class ) ) ; _pubsubMessageItemStream = ( PubSubMessageItemStream ) cursor . next ( ) ; if ( _pubsubMessageItemStream == null ) { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "DESTINATION_HANDLER_RECOVERY_ERROR_CWSIP0048" , new Object [ ] { _baseDestinationHandler . getName ( ) } , null ) ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.reconstitute" , "1:458:1.35.2.4" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstitute" , e ) ; throw e ; } cursor . finished ( ) ; _pubsubMessageItemStream . reconstitute ( _baseDestinationHandler ) ; _localisationManager . setLocal ( ) ; cursor = _pubsubMessageItemStream . newNonLockingReferenceStreamCursor ( new ClassEqualsFilter ( ProxyReferenceStream . class ) ) ; _proxyReferenceStream = ( ProxyReferenceStream ) cursor . next ( ) ; if ( _proxyReferenceStream == null ) { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "DESTINATION_HANDLER_RECOVERY_ERROR_CWSIP0048" , new Object [ ] { _baseDestinationHandler . getName ( ) } , null ) ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.reconstitute" , "1:491:1.35.2.4" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstitute" , e ) ; throw e ; } _pubsubMessageItemStream . incrementReferenceStreamCount ( ) ; cursor . finished ( ) ; createInputHandlersForPubSub ( ) ; reconstituteDurableSubscriptions ( ) ; _pubSubRemoteSupport . reconstituteSourceStreams ( startMode , null ) ; _pubSubRemoteSupport . reconstituteRemoteDurable ( startMode , _consumerDispatchersDurable ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstitute" ) ; }
There will only be one such proxy reference stream .
162,983
public ConsumerDispatcher createSubscriptionConsumerDispatcher ( ConsumerDispatcherState subState ) throws SIDiscriminatorSyntaxException , SISelectorSyntaxException , SIResourceException , SISelectorSyntaxException , SIDiscriminatorSyntaxException , SINonDurableSubscriptionMismatchException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createSubscriptionConsumerDispatcher" , subState ) ; ConsumerDispatcher cd = null ; boolean isNewCDcreated = false ; if ( subState . getSubscriberID ( ) == null ) { cd = createSubscriptionItemStreamAndConsumerDispatcher ( subState , false ) ; } else { cd = ( ConsumerDispatcher ) _destinationManager . getNondurableSharedSubscriptions ( ) . get ( subState . getSubscriberID ( ) ) ; if ( cd == null ) { synchronized ( _destinationManager . getNondurableSharedSubscriptions ( ) ) { cd = ( ConsumerDispatcher ) _destinationManager . getNondurableSharedSubscriptions ( ) . get ( subState . getSubscriberID ( ) ) ; if ( cd == null ) { cd = createSubscriptionItemStreamAndConsumerDispatcher ( subState , true ) ; isNewCDcreated = true ; } } } } if ( ! isNewCDcreated && ( subState . getSubscriberID ( ) != null ) ) { if ( ! cd . getConsumerDispatcherState ( ) . equals ( subState ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createSubscriptionConsumerDispatcher" , subState ) ; throw new SINonDurableSubscriptionMismatchException ( nls . getFormattedMessage ( "SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143" , new Object [ ] { subState . getSubscriberID ( ) , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createSubscriptionConsumerDispatcher" , cd ) ; return cd ; }
however nobody is calling this thru AbstractAliasDestinationHandler in Liberty .
162,984
public ConsumableKey attachToLocalDurableSubscription ( LocalConsumerPoint consumerPoint , ConsumerDispatcherState subState ) throws SIDurableSubscriptionMismatchException , SIDurableSubscriptionNotFoundException , SIDestinationLockedException , SISelectorSyntaxException , SIDiscriminatorSyntaxException , SINotPossibleInCurrentConfigurationException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "attachToLocalDurableSubscription" , new Object [ ] { consumerPoint , subState } ) ; ConsumerDispatcher consumerDispatcher = null ; ConsumableKey data = null ; synchronized ( _consumerDispatchersDurable ) { consumerDispatcher = getDurableSubscriptionConsumerDispatcher ( subState ) ; if ( consumerDispatcher != null ) { if ( consumerDispatcher . hasConsumersAttached ( ) && ! subState . isCloned ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "attachToLocalDurableSubscription" , "Consumers already attached" ) ; throw new SIDestinationLockedException ( nls . getFormattedMessage ( "SUBSCRIPTION_IN_USE_ERROR_CWSIP0152" , new Object [ ] { subState . getSubscriberID ( ) , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; } if ( ! consumerDispatcher . getConsumerDispatcherState ( ) . isReady ( ) || ! consumerDispatcher . getConsumerDispatcherState ( ) . equals ( subState ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "attachToLocalDurableSubscription" , subState ) ; throw new SIDurableSubscriptionMismatchException ( nls . getFormattedMessage ( "SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143" , new Object [ ] { subState . getSubscriberID ( ) , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; } if ( _messageProcessor . isBusSecure ( ) ) { if ( ! consumerDispatcher . getConsumerDispatcherState ( ) . equalUser ( subState ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "attachToLocalDurableSubscription" , subState ) ; throw new SIDurableSubscriptionMismatchException ( nls . getFormattedMessage ( "USER_NOT_AUTH_ACTIVATE_ERROR_CWSIP0312" , new Object [ ] { subState . getUser ( ) , subState . getSubscriberID ( ) , _baseDestinationHandler . getName ( ) } , null ) ) ; } } data = ( ConsumableKey ) consumerDispatcher . attachConsumerPoint ( consumerPoint , null , consumerPoint . getConsumerSession ( ) . getConnectionUuid ( ) , consumerPoint . getConsumerSession ( ) . getReadAhead ( ) , consumerPoint . getConsumerSession ( ) . getForwardScanning ( ) , null ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "attachToLocalDurableSubscription" , "SIDurableSubscriptionNotFoundException" ) ; throw new SIDurableSubscriptionNotFoundException ( nls . getFormattedMessage ( "SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0146" , new Object [ ] { subState . getSubscriberID ( ) , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "attachToLocalDurableSubscription" , data ) ; return data ; }
Attaches to a created DurableSubscription which is homed on the local ME .
162,985
public SubscriptionIndex getSubscriptionIndex ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getSubscriptionIndex" ) ; SibTr . exit ( tc , "getSubscriptionIndex" , _subscriptionIndex ) ; } return _subscriptionIndex ; }
Retrieve the subscription index for this destination .
162,986
private boolean checkDurableSubStillValid ( DurableSubscriptionItemStream durableSub ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkDurableSubStillValid" , durableSub ) ; boolean valid = false ; ConsumerDispatcherState cdState = durableSub . getConsumerDispatcherState ( ) ; if ( durableSub . isToBeDeleted ( ) ) { valid = false ; _destinationManager . addSubscriptionToDelete ( durableSub ) ; } else if ( cdState . getTopicSpaceUuid ( ) . equals ( _baseDestinationHandler . getUuid ( ) ) ) { valid = true ; } else { try { BaseDestinationDefinition dh = _destinationManager . getLocalME ( ) . getMessagingEngine ( ) . getSIBDestination ( cdState . getTopicSpaceBusName ( ) , cdState . getTopicSpaceName ( ) ) ; if ( dh . getUUID ( ) . equals ( cdState . getTopicSpaceUuid ( ) ) ) { valid = true ; } else { durableSub . markAsToBeDeleted ( ) ; try { durableSub . requestUpdate ( _messageProcessor . getTXManager ( ) . createAutoCommitTransaction ( ) ) ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid" , "1:3667:1.35.2.4" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkDurableSubStillValid" , "SIResourceException - Failed to update durable sub to delete." ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid" , "1:3684:1.35.2.4" , e } , null ) ) ; } durableSub . deleteIfPossible ( false ) ; } } catch ( SIBExceptionBase e ) { durableSub . markAsToBeDeleted ( ) ; try { durableSub . requestUpdate ( _messageProcessor . getTXManager ( ) . createAutoCommitTransaction ( ) ) ; } catch ( MessageStoreException e1 ) { FFDCFilter . processException ( e1 , "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid" , "1:3712:1.35.2.4" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkDurableSubStillValid" , "SIResourceException - Failed to update durable sub to delete." ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.checkDurableSubStillValid" , "1:3729:1.35.2.4" , e } , null ) ) ; } durableSub . deleteIfPossible ( false ) ; _messageProcessor . getProxyHandler ( ) . unsubscribeEvent ( cdState , _baseDestinationHandler . getTransactionManager ( ) . createAutoCommitTransaction ( ) , true ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkDurableSubStillValid" , new Boolean ( valid ) ) ; return valid ; }
Ensure that if the durable sub was made through an alias then the alias still exists
162,987
public MessageItem retrieveMessageFromItemStream ( long msgStoreID ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "retrieveMessageFromItemStream" , new Long ( msgStoreID ) ) ; MessageItem msgItem = null ; try { msgItem = ( MessageItem ) _pubsubMessageItemStream . findById ( msgStoreID ) ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.destination.PubSubRealization.retrieveMessageFromItemStream" , "1:3797:1.35.2.4" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "retrieveMessageFromItemStream" , e ) ; throw new SIResourceException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "retrieveMessageFromItemStream" , msgItem ) ; return msgItem ; }
Retrieve the message from the non - persistent ItemStream
162,988
@ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public static Object getRegisterableMBean ( ServiceReference < ? > serviceReference , Object mBean ) throws NotCompliantMBeanException { if ( mBean instanceof DynamicMBean ) { return mBean ; } else if ( mBean instanceof ConfigurationAdminMBean ) { Object readOnlyMBean = new ReadOnlyConfigurationAdmin ( ( ConfigurationAdminMBean ) mBean ) ; return readOnlyMBean ; } Class < ? > fallbackInterface = null ; Class < ? > mBeanClass = mBean . getClass ( ) ; String directInterfaceName = mBeanClass . getName ( ) + "MBean" ; List < String > publishedInterfaceNames = Arrays . asList ( ( String [ ] ) serviceReference . getProperty ( Constants . OBJECTCLASS ) ) ; for ( Class < ? > nextInterface : mBeanClass . getInterfaces ( ) ) { String nextInterfaceName = nextInterface . getName ( ) ; if ( ! publishedInterfaceNames . contains ( nextInterfaceName ) ) { continue ; } if ( nextInterfaceName . equals ( directInterfaceName ) ) { return mBean ; } MXBean mxbean = nextInterface . getAnnotation ( MXBean . class ) ; if ( mxbean != null ) { if ( mxbean . value ( ) ) { return mBean ; } else { } } else { if ( nextInterfaceName . endsWith ( "MXBean" ) ) { return mBean ; } } if ( nextInterfaceName . endsWith ( "MBean" ) ) { fallbackInterface = nextInterface ; } } if ( fallbackInterface == null ) { StringBuilder errorMessage = new StringBuilder ( ) ; errorMessage . append ( "Unregisterable MBean: [ " + mBeanClass . getName ( ) + " ]" ) ; for ( Class < ? > nextInterface : mBeanClass . getInterfaces ( ) ) { errorMessage . append ( " implements [ " + nextInterface . getName ( ) + " ]" ) ; } for ( String publishedName : ( String [ ] ) serviceReference . getProperty ( Constants . OBJECTCLASS ) ) { errorMessage . append ( " published [ " + publishedName + " ]" ) ; } throw new NotCompliantMBeanException ( errorMessage . toString ( ) ) ; } Object standardMBean ; if ( mBean instanceof NotificationEmitter ) { standardMBean = new StandardEmitterMBean ( mBean , ( Class ) fallbackInterface , ( NotificationEmitter ) mBean ) ; } else { standardMBean = new StandardMBean ( mBean , ( Class ) fallbackInterface ) ; } return standardMBean ; }
Register an object as a managed bean . Wrapper the object if necessary .
162,989
private void traceJndiBegin ( String methodname , Object ... objs ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { String providerURL = "UNKNOWN" ; try { providerURL = ( String ) getEnvironment ( ) . get ( Context . PROVIDER_URL ) ; } catch ( NamingException ne ) { } Tr . debug ( tc , JNDI_CALL + methodname + " [" + providerURL + "]" , objs ) ; } }
Trace a message with JNDI_CALL that includes the parameters sent to the JNDI call .
162,990
private void traceJndiReturn ( String methodname , long duration , Object ... objs ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , JNDI_CALL + methodname + " [" + duration + " ms]" , objs ) ; } }
Trace a message with JNDI_CALL that includes the returned objects from that JNDI call .
162,991
private void traceJndiThrow ( String methodname , long duration , NamingException ne ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , JNDI_CALL + methodname + " [" + duration + " ms] " + ne . getMessage ( ) , ne ) ; } }
Trace a message with JNDI_CALL that includes the resulting exception from that JNDI call .
162,992
public void encodeChildren ( FacesContext context , UIComponent component ) throws IOException { if ( context == null ) { throw new NullPointerException ( "context" ) ; } if ( component == null ) { throw new NullPointerException ( "component" ) ; } if ( component . getChildCount ( ) > 0 ) { for ( int i = 0 , childCount = component . getChildCount ( ) ; i < childCount ; i ++ ) { UIComponent child = component . getChildren ( ) . get ( i ) ; if ( ! child . isRendered ( ) ) { continue ; } child . encodeAll ( context ) ; } } }
Render all children if there are any .
162,993
void registerCallback ( AsynchConsumerCallback callback ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "registerCallback" , callback ) ; asynchConsumerCallback = callback ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "registerCallback" ) ; }
Register the AsynchConsumerCallback . If callback is null then this is the equivalent of deregister i . e . callbackRegistered is set to false .
162,994
void processMsgs ( LockedMessageEnumeration msgEnumeration , ConsumerSession consumerSession ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "processMsgs" , new Object [ ] { msgEnumeration , consumerSession } ) ; asynchConsumerRunning = true ; try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Entering asynchConsumerCallback.consumeMessages" , new Object [ ] { asynchConsumerCallback , msgEnumeration } ) ; asynchConsumerCallback . consumeMessages ( msgEnumeration ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Exiting asynchConsumerCallback.consumeMessages" ) ; } catch ( Throwable e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.AsynchConsumer.processMsgs" , "1:124:1.37" , this ) ; if ( consumerSession != null ) { try { notifyExceptionListeners ( e , consumerSession ) ; } catch ( Exception connectionClosed ) { } } if ( e instanceof Exception ) SibTr . exception ( tc , ( Exception ) e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Exception occurred in consumeMessages " + e ) ; if ( e instanceof ThreadDeath ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processMsgs" , e ) ; throw ( ThreadDeath ) e ; } } finally { asynchConsumerRunning = false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "processMsgs" ) ; }
Calls the registered AsynchConsumerCallback with the given message enumeration .
162,995
boolean isAsynchConsumerRunning ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "isAsynchConsumerRunning" ) ; SibTr . exit ( tc , "isAsynchConsumerRunning" , new Boolean ( asynchConsumerRunning ) ) ; } return asynchConsumerRunning ; }
Is the callback currently running?
162,996
private long sendMessage ( SIBusMessage msg ) throws OperationFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendMessage" , msg ) ; long retValue = 0 ; final HandshakeProperties props = getConversation ( ) . getHandshakeProperties ( ) ; if ( props . getFapLevel ( ) >= JFapChannelConstants . FAP_VERSION_9 ) { retValue = sendChunkedMessage ( msg ) ; } else { retValue = sendEntireMessage ( msg , null ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendMessage" , "" + retValue ) ; return retValue ; }
Helper function . Sends an SIBusMessage to the client taking care of the myriad pesky exceptions which may get thrown . If something does go wrong then the caller is notified by a single OperationFailedException . By this point the appropriate error flow has also been transmitted to the client .
162,997
public void reset ( ) throws SISessionUnavailableException , SISessionDroppedException , SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "reset" ) ; BrowserSession browserSession = mainConsumer . getBrowserSession ( ) ; ++ msgBatch ; browserSession . reset ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "reset" ) ; }
Called in response to a client requesting we reset the browse cursor for a particular broser session .
162,998
public void flush ( int requestNumber ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "flush" , "" + requestNumber ) ; BrowserSession browserSession = mainConsumer . getBrowserSession ( ) ; SIBusMessage msg = null ; try { msg = getNextMessage ( browserSession , getConversation ( ) , ( short ) requestNumber ) ; if ( msg != null ) sendMessage ( msg ) ; try { getConversation ( ) . send ( poolManager . allocate ( ) , JFapChannelConstants . SEG_FLUSH_SESS_R , requestNumber , Conversation . PRIORITY_LOWEST , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".flush" , CommsConstants . CATBROWSECONSUMER_FLUSH_01 , this ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2012" , e ) ; } } catch ( OperationFailedException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . exception ( this , tc , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "flush" ) ; }
Invoked when the client sends a flush consumer . Since browser sessions do not have an activeConsumer method this translates to attempting a single browse next and sending back the result .
162,999
public void close ( int requestNumber ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" , "" + requestNumber ) ; BrowserSession browserSession = mainConsumer . getBrowserSession ( ) ; try { browserSession . close ( ) ; } catch ( SIException e ) { if ( ! ( ( ConversationState ) getConversation ( ) . getAttachment ( ) ) . hasMETerminated ( ) ) { FFDCFilter . processException ( e , CLASS_NAME + ".close" , CommsConstants . CATBROWSECONSUMER_CLOSE_01 , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; StaticCATHelper . sendExceptionToClient ( e , CommsConstants . CATBROWSECONSUMER_CLOSE_01 , getConversation ( ) , requestNumber ) ; } try { getConversation ( ) . send ( poolManager . allocate ( ) , JFapChannelConstants . SEG_CLOSE_CONSUMER_SESS_R , requestNumber , Conversation . PRIORITY_LOWEST , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".close" , CommsConstants . CATBROWSECONSUMER_CLOSE_02 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ; }
Closes the browser .