idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
36,900
protected void setLayoutToPrimary ( int segmentLength , int priority , boolean isPooled , boolean isExchange , int packetNumber , int segmentType , SendListener sendListener ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setLayoutToPrimary" , new Object [ ] { "" + segmentLength , "" + priority , "" + isPooled , "" + isExchange , "" + packetNumber , "" + segmentType , sendListener } ) ; primaryHeaderFields . segmentLength = segmentLength ; primaryHeaderFields . priority = priority ; primaryHeaderFields . isPooled = isPooled ; primaryHeaderFields . isExchange = isExchange ; primaryHeaderFields . packetNumber = packetNumber ; primaryHeaderFields . segmentType = segmentType ; this . sendListener = sendListener ; transmissionRemaining = segmentLength ; layout = JFapChannelConstants . XMIT_PRIMARY_ONLY ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setLayoutToPrimary" ) ; }
Sets the layout to use for this transmission to be a primary header only .
36,901
protected void setLayoutToConversation ( int segmentLength , int priority , boolean isPooled , boolean isExchange , int packetNumber , int segmentType , int conversationId , int requestNumber , Conversation conversation , SendListener sendListener ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setLayoutToConversation" , new Object [ ] { "" + segmentLength , "" + priority , "" + isPooled , "" + isExchange , "" + packetNumber , "" + segmentType , "" + conversationId , "" + requestNumber , conversation , sendListener } ) ; setLayoutToPrimary ( segmentLength , priority , isPooled , isExchange , packetNumber , segmentType , sendListener ) ; conversationHeaderFields . conversationId = conversationId ; conversationHeaderFields . requestNumber = requestNumber ; this . conversation = conversation ; transmissionRemaining = segmentLength ; layout = JFapChannelConstants . XMIT_CONVERSATION ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setLayoutToConversation" ) ; }
Set layout for transmission to build to have a conversation header .
36,902
protected void setLayoutToStartSegment ( int segmentLength , int priority , boolean isPooled , boolean isExchange , int packetNumber , int segmentType , int conversationId , int requestNumber , long totalLength ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setLayoutToStartSegment" , new Object [ ] { "" + segmentLength , "" + priority , "" + isPooled , "" + isExchange , "" + packetNumber , "" + segmentType , "" + conversationId , "" + requestNumber , "" + totalLength } ) ; setLayoutToConversation ( segmentLength , priority , isPooled , isExchange , packetNumber , segmentType , conversationId , requestNumber , null , null ) ; segmentedTransmissionHeaderFields . totalLength = totalLength ; segmentedTransmissionHeaderFields . segmentType = segmentType ; transmissionRemaining = segmentLength ; primaryHeaderFields . segmentType = JFapChannelConstants . SEGMENT_SEGMENTED_FLOW_START ; layout = JFapChannelConstants . XMIT_SEGMENT_START ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setLayoutToStartSegment" ) ; }
Set next transmission being built to have a segment start layout
36,903
protected void setLayoutToMiddleSegment ( int segmentLength , int priority , boolean isPooled , boolean isExchange , int packetNumber , int conversationId , int requestNumber ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setLayoutToMiddleSegment" , new Object [ ] { "" + segmentLength , "" + priority , "" + isPooled , "" + isExchange , "" + packetNumber , "" + conversationId , "" + requestNumber } ) ; setLayoutToConversation ( segmentLength , priority , isPooled , isExchange , packetNumber , JFapChannelConstants . SEGMENT_SEGMENTED_FLOW_MIDDLE , conversationId , requestNumber , null , null ) ; layout = JFapChannelConstants . XMIT_SEGMENT_MIDDLE ; transmissionRemaining = segmentLength ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setLayoutToMiddleSegment" ) ; }
Set next transmission being built to have a segment middle layout
36,904
protected void setLayoutToEndSegment ( int segmentLength , int priority , boolean isPooled , boolean isExchange , int packetNumber , int conversationId , int requestNumber , Conversation conversation , SendListener sendListener ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setLayoutToSegmentEnd" , new Object [ ] { "" + segmentLength , "" + priority , "" + isPooled , "" + isExchange , "" + packetNumber , "" + conversationId , "" + requestNumber , conversation , sendListener } ) ; setLayoutToConversation ( segmentLength , priority , isPooled , isExchange , packetNumber , JFapChannelConstants . SEGMENT_SEGMENTED_FLOW_END , conversationId , requestNumber , conversation , sendListener ) ; layout = JFapChannelConstants . XMIT_SEGMENT_END ; transmissionRemaining = segmentLength ; }
Set next transmission being built to have a segment end layout
36,905
protected boolean isPooledBuffers ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isPooledBuffers" ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isPooledBuffers" , "" + primaryHeaderFields . isPooled ) ; return primaryHeaderFields . isPooled ; }
Returns true iff this transmission should be received into pooled buffers .
36,906
protected boolean isUserRequest ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isUserRequest" ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isUserRequest" , "" + isUserRequest ) ; return isUserRequest ; }
Returns true iff this transmission is a user request .
36,907
protected boolean isTerminal ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isTermainl" ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isTermainl" , "" + isTerminal ) ; return isTerminal ; }
Returns true if this transmission should stop this connection from writing any more data to the socket .
36,908
private boolean buildHeader ( HeaderFields headerFields , WsByteBuffer xmitBuffer ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "buildHeader" , new Object [ ] { headerFields , xmitBuffer } ) ; if ( tc . isDebugEnabled ( ) ) JFapUtils . debugTraceWsByteBufferInfo ( this , tc , xmitBuffer , "xmitBuffer" ) ; boolean headerFinished = false ; WsByteBuffer headerBuffer = null ; if ( headerScratchSpace . position ( ) == 0 ) { if ( tc . isDebugEnabled ( ) ) JFapUtils . debugTraceWsByteBufferInfo ( this , tc , headerScratchSpace , "headerScratchSpace" ) ; if ( xmitBuffer . remaining ( ) >= headerFields . sizeof ( ) ) { headerBuffer = xmitBuffer ; headerFields . writeToBuffer ( xmitBuffer ) ; headerFinished = true ; } else { headerBuffer = headerScratchSpace ; headerFields . writeToBuffer ( headerScratchSpace ) ; headerScratchSpace . flip ( ) ; } } else { headerBuffer = headerScratchSpace ; } if ( ! headerFinished ) { int headerLeftToCopy = headerBuffer . remaining ( ) ; int amountCopied = JFapUtils . copyWsByteBuffer ( headerBuffer , xmitBuffer , headerLeftToCopy ) ; headerFinished = amountCopied == headerLeftToCopy ; } if ( headerFinished ) { headerScratchSpace . clear ( ) ; transmissionRemaining -= headerFields . sizeof ( ) ; } else exhausedXmitBuffer = true ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "buildHeader" , "" + headerFinished ) ; return headerFinished ; }
Builds a header from a description of the header fields . The header is incrementally built into the supplied transmission buffer . This may require use of a scratch space in the event that there is insufficient room in the transmission buffer on the first attempt .
36,909
private boolean buildPayload ( WsByteBuffer xmitBuffer ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "buildPayload" , xmitBuffer ) ; if ( tc . isDebugEnabled ( ) ) JFapUtils . debugTraceWsByteBufferInfo ( this , tc , xmitBuffer , "xmitBuffer" ) ; boolean payloadFinished = false ; int amountCopied , amountToCopy ; if ( xmitDataBuffers . length == 0 ) { if ( tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "payload finished" ) ; payloadFinished = true ; } else { do { amountToCopy = xmitDataBuffers [ currentXmitDataBufferIndex ] . remaining ( ) ; if ( amountToCopy > transmissionRemaining ) amountToCopy = transmissionRemaining ; amountCopied = JFapUtils . copyWsByteBuffer ( xmitDataBuffers [ currentXmitDataBufferIndex ] , xmitBuffer , amountToCopy ) ; if ( tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "amountToCopy=" + amountToCopy + " amountCopied=" + amountCopied + " currentXmitDataBufferIndex=" + currentXmitDataBufferIndex ) ; transmissionRemaining -= amountCopied ; if ( amountCopied == amountToCopy ) { ++ currentXmitDataBufferIndex ; payloadFinished = ( currentXmitDataBufferIndex == xmitDataBuffers . length ) ; } if ( ( amountCopied < amountToCopy ) || ( transmissionRemaining < 1 ) ) { exhausedXmitBuffer = true ; } } while ( ( amountCopied == amountToCopy ) && ( ! payloadFinished ) && ( ! exhausedXmitBuffer ) ) ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "buildPayload" , "" + payloadFinished ) ; return payloadFinished ; }
Builds a transmission payload into the supplied buffer . This may be done incrementally by multiple invocations in the case that the supplied buffer is smaller than the payload being built .
36,910
@ Path ( "/verifyInjectedOptionalCustomMissing" ) @ Produces ( MediaType . APPLICATION_JSON ) public JsonObject verifyInjectedOptionalCustomMissing ( ) { boolean pass = false ; String msg ; Optional < Long > customValue = custom . getValue ( ) ; if ( customValue == null ) { msg = "custom-missing value is null, FAIL" ; } else if ( ! customValue . isPresent ( ) ) { msg = "custom-missing PASS" ; pass = true ; } else { msg = String . format ( "custom: %s != %s" , null , customValue . get ( ) ) ; } JsonObject result = Json . createObjectBuilder ( ) . add ( "pass" , pass ) . add ( "msg" , msg ) . build ( ) ; return result ; }
Verify that values exist and that types match the corresponding Claims enum
36,911
public static void addExtendedProperty ( String propName , String dataType , boolean multiValued , Object defaultValue ) { if ( dataType == null || "null" . equalsIgnoreCase ( dataType ) ) return ; if ( extendedPropertiesDataType . containsKey ( propName ) ) { Tr . warning ( tc , WIMMessageKey . DUPLICATE_PROPERTY_EXTENDED , new Object [ ] { propName , "PersonAccount" } ) ; return ; } if ( getPropertyNames ( "PersonAccount" ) . contains ( propName ) ) { Tr . warning ( tc , WIMMessageKey . DUPLICATE_PROPERTY_ENTITY , new Object [ ] { propName , "PersonAccount" } ) ; return ; } extendedPropertiesDataType . put ( propName , dataType ) ; if ( defaultValue != null ) extendedPropertiesDefaultValue . put ( propName , defaultValue ) ; if ( multiValued ) extendedMultiValuedProperties . add ( propName ) ; }
Allows for an extended property or a property not pre - defined as part of this PersonAccount entity type to be added to the PersonAccount entity
36,912
private static String depluralize ( String s ) { if ( s . endsWith ( "ies" ) ) { return s . substring ( 0 , s . length ( ) - 3 ) + 'y' ; } if ( s . endsWith ( "s" ) ) { return s . substring ( 0 , s . length ( ) - 1 ) ; } return s ; }
Convert a string like abcs to abc .
36,913
private static String hyphenatedToCamelCase ( String s ) { Matcher m = Pattern . compile ( "(?:^|-)([a-z])" ) . matcher ( s ) ; StringBuilder b = new StringBuilder ( ) ; int last = 0 ; for ( ; m . find ( ) ; last = m . end ( ) ) { b . append ( s , last , m . start ( ) ) . append ( Character . toUpperCase ( m . group ( 1 ) . charAt ( 0 ) ) ) ; } return b . append ( s , last , s . length ( ) ) . toString ( ) ; }
Convert a string like abc - def - ghi to AbcDefGhi .
36,914
private static String upperCaseFirstChar ( String s ) { return Character . toUpperCase ( s . charAt ( 0 ) ) + s . substring ( 1 ) ; }
Convert a string like abcDef to AbcDef .
36,915
private static List < TypeMirror > getAnnotationClassValues ( Element member , Annotation annotation , String annotationMemberName ) { for ( AnnotationMirror annotationMirror : member . getAnnotationMirrors ( ) ) { if ( ( ( TypeElement ) annotationMirror . getAnnotationType ( ) . asElement ( ) ) . getQualifiedName ( ) . contentEquals ( annotation . annotationType ( ) . getName ( ) ) ) { for ( Map . Entry < ? extends ExecutableElement , ? extends AnnotationValue > entry : annotationMirror . getElementValues ( ) . entrySet ( ) ) { if ( entry . getKey ( ) . getSimpleName ( ) . contentEquals ( annotationMemberName ) ) { @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) List < AnnotationValue > types = ( List ) entry . getValue ( ) . getValue ( ) ; TypeMirror [ ] result = new TypeMirror [ types . size ( ) ] ; for ( int i = 0 ; i < types . size ( ) ; i ++ ) { result [ i ] = ( TypeMirror ) types . get ( i ) . getValue ( ) ; } return Arrays . asList ( result ) ; } } return Collections . emptyList ( ) ; } } throw new IllegalStateException ( annotation . annotationType ( ) . getName ( ) + " not found in " + member ) ; }
Return a List of TypeMirror for an annotation on a member . This is a workaround for JDK - 6519115 which causes MirroredTypeException to be thrown rather than MirroredTypesException .
36,916
public ViewScopeContextualStorage getContextualStorage ( BeanManager beanManager , String viewScopeId ) { ViewScopeContextualStorage contextualStorage = storageMap . get ( viewScopeId ) ; if ( contextualStorage == null ) { synchronized ( this ) { contextualStorage = storageMap . get ( viewScopeId ) ; if ( contextualStorage == null ) { contextualStorage = new ViewScopeContextualStorage ( beanManager ) ; storageMap . put ( viewScopeId , contextualStorage ) ; } } } return contextualStorage ; }
This method will return the ViewScopeContextualStorage or create a new one if no one is yet assigned to the current windowId .
36,917
public AuthConfigProvider setProvider ( ProviderService providerService ) { AuthConfigProvider authConfigProvider = null ; if ( providerService != null ) { authConfigProvider = providerService . getAuthConfigProvider ( this ) ; registerConfigProvider ( authConfigProvider , null , null , null ) ; } else { removeRegistration ( defaultRegistrationID . toString ( ) ) ; } return authConfigProvider ; }
Called when a Liberty user defined feature provider is set or unset
36,918
protected BeanO doActivation ( EJBThreadData threadData , ContainerTx tx , BeanId beanId , boolean takeInvocationRef ) throws RemoteException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "doActivation" , new Object [ ] { tx , beanId , new Boolean ( takeInvocationRef ) } ) ; } BeanO bean = null ; Throwable exception = null ; MasterKey key = new MasterKey ( beanId ) ; boolean activate = false ; boolean pushedCallbackBeanO = false ; try { synchronized ( locks . getLock ( key ) ) { if ( ( bean = ( BeanO ) cache . find ( key ) ) == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Bean not in cache" ) ; bean = beanId . getHome ( ) . createBeanO ( threadData , tx , beanId ) ; pushedCallbackBeanO = true ; cache . insert ( key , bean ) ; bean . ivCacheKey = key ; activate = true ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Found bean in cache" ) ; threadData . pushCallbackBeanO ( bean ) ; pushedCallbackBeanO = true ; } } boolean pin = false ; if ( activate ) { bean . activate ( beanId , tx ) ; } pin = bean . enlist ( tx ) ; if ( takeInvocationRef && pin ) { cache . pin ( key ) ; } else if ( ! takeInvocationRef && ! pin ) { cache . unpin ( key ) ; } } catch ( RemoteException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".doActivation" , "123" , this ) ; exception = e ; throw e ; } catch ( RuntimeException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".doActivation" , "129" , this ) ; exception = e ; throw e ; } finally { if ( exception != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "doActivation: exception raised" , exception ) ; } if ( exception != null && bean != null ) { if ( pushedCallbackBeanO ) { threadData . popCallbackBeanO ( ) ; } bean . destroy ( ) ; if ( activate ) { synchronized ( locks . getLock ( key ) ) { cache . remove ( key , true ) ; bean . ivCacheKey = null ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "doActivation" , bean ) ; } return bean ; }
Internal method used by subclasses to activate a bean
36,919
public Entry < BatchPartitionWorkUnit , Future < ? > > startPartition ( PartitionPlanConfig partitionPlanConfig , Step step , PartitionReplyQueue partitionReplyQueue , boolean isRemoteDispatch ) { BatchPartitionWorkUnit workUnit = createPartitionWorkUnit ( partitionPlanConfig , step , partitionReplyQueue , isRemoteDispatch ) ; Future < ? > futureWork = runPartition ( workUnit ) ; return new AbstractMap . SimpleEntry < BatchPartitionWorkUnit , Future < ? > > ( workUnit , futureWork ) ; }
Create the BatchPartitionWorkUnit and start the sub - job partition thread .
36,920
protected void setConversation ( Conversation conversation ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setConversation" , conversation ) ; con = conversation ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setConversation" ) ; }
Sets the Conversation object
36,921
protected CommsByteBuffer jfapExchange ( CommsByteBuffer buffer , int sendSegmentType , int priority , boolean canPoolOnReceive ) throws SIConnectionDroppedException , SIConnectionLostException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "jfapExchange" , new Object [ ] { buffer , sendSegmentType , priority , canPoolOnReceive } ) ; boolean success = false ; CommsByteBuffer rcvBuffer = null ; try { if ( buffer == null ) { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "NULL_DATA_LIST_PASSED_IN_SICO1046" , null , null ) ) ; FFDCFilter . processException ( e , CLASS_NAME + ".JFAPExchange" , CommsConstants . JFAPCOMMUNICATOR_EXCHANGE_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , e . getMessage ( ) , e ) ; throw e ; } int reqNum = getRequestNumber ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( this , tc , "About to Exchange segment " + "conversation: " + con + " " + JFapChannelConstants . getSegmentName ( sendSegmentType ) + " - " + sendSegmentType + " (0x" + Integer . toHexString ( sendSegmentType ) + ") " + "using request number " + reqNum ) ; SibTr . debug ( this , tc , con . getFullSummary ( ) ) ; } ReceivedData rd = con . exchange ( buffer , sendSegmentType , reqNum , priority , canPoolOnReceive ) ; rcvBuffer = getCommsByteBuffer ( rd ) ; int rcvSegmentType = rcvBuffer . getReceivedDataSegmentType ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Exchange completed successfully. " + "Segment returned " + JFapChannelConstants . getSegmentName ( rcvSegmentType ) + " - " + rcvSegmentType + " (0x" + Integer . toHexString ( rcvSegmentType ) + ")" ) ; success = true ; } finally { if ( ! success && TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Exchange failed." ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "jfapExchange" , rcvBuffer ) ; } return rcvBuffer ; }
Wraps the JFAP Channel exchange method to allow tracing retrieval of Unique request numbers and setting of message priority .
36,922
protected void jfapSend ( CommsByteBuffer buffer , int sendSegType , int priority , boolean canPoolOnReceive , ThrottlingPolicy throttlingPolicy ) throws SIConnectionDroppedException , SIConnectionLostException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "jfapSend" , new Object [ ] { buffer , sendSegType , priority , canPoolOnReceive } ) ; if ( buffer == null ) { SIErrorException e = new SIErrorException ( nls . getFormattedMessage ( "NULL_DATA_LIST_PASSED_IN_SICO1046" , null , null ) ) ; FFDCFilter . processException ( e , CLASS_NAME + ".JFAPSend" , CommsConstants . JFAPCOMMUNICATOR_SEND_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , e . getMessage ( ) , e ) ; throw e ; } int reqNum = 0 ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( this , tc , "About to Send segment " + "conversation: " + con + " " + JFapChannelConstants . getSegmentName ( sendSegType ) + " - " + sendSegType + " (0x" + Integer . toHexString ( sendSegType ) + ") " + "using request number " + reqNum ) ; SibTr . debug ( this , tc , con . getFullSummary ( ) ) ; } con . send ( buffer , sendSegType , reqNum , priority , canPoolOnReceive , throttlingPolicy , null ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "jfapSend" ) ; }
Wraps the JFAP Channel send method to allow tracing retrieval of Unique request numbers and setting of message priority .
36,923
private short getClientCapabilities ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getClientCapabilities" ) ; short capabilities = CommsConstants . CAPABILITIES_DEFAULT ; boolean nonJavaBootstrap = CommsUtils . getRuntimeBooleanProperty ( CommsConstants . CAPABILITIY_REQUIRES_NONJAVA_BOOTSTRAP_KEY , CommsConstants . CAPABILITIY_REQUIRES_NONJAVA_BOOTSTRAP_DEF ) ; if ( nonJavaBootstrap ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Requesting non-java bootstrap" ) ; capabilities |= CommsConstants . CAPABILITIY_REQUIRES_NONJAVA_BOOTSTRAP ; } boolean jmfMessagesOnly = CommsUtils . getRuntimeBooleanProperty ( CommsConstants . CAPABILITIY_REQUIRES_JMF_ENCODING_KEY , CommsConstants . CAPABILITIY_REQUIRES_JMF_ENCODING_DEF ) ; if ( jmfMessagesOnly ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Requesting JMF Only" ) ; capabilities |= CommsConstants . CAPABILITIY_REQUIRES_JMF_ENCODING ; } boolean jmsMessagesOnly = CommsUtils . getRuntimeBooleanProperty ( CommsConstants . CAPABILITIY_REQUIRES_JMS_MESSAGES_KEY , CommsConstants . CAPABILITIY_REQUIRES_JMS_MESSAGES_DEF ) ; if ( jmsMessagesOnly ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Requesting JMS Only" ) ; capabilities |= CommsConstants . CAPABILITIY_REQUIRES_JMS_MESSAGES ; } boolean disableOptimizedTx = CommsUtils . getRuntimeBooleanProperty ( CommsConstants . DISABLE_OPTIMIZED_TX_KEY , CommsConstants . DISABLE_OPTIMIZED_TX ) ; if ( disableOptimizedTx ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Disabling use of optimized transactions" ) ; capabilities &= ( 0xFFFF ^ CommsConstants . CAPABILITIY_REQUIRES_OPTIMIZED_TX ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getClientCapabilities" , capabilities ) ; return capabilities ; }
Works out the capabilities that will be sent to the peer as part of the initial handshake . This also takes into account any overrides from the SIB properties file .
36,924
public void defaultChecker ( CommsByteBuffer buffer , short exceptionCode ) throws SIErrorException { if ( exceptionCode != CommsConstants . SI_NO_EXCEPTION ) { throw new SIErrorException ( buffer . getException ( con ) ) ; } }
The default checker . Should always be called last after all the checkers .
36,925
protected void invalidateConnection ( boolean notifyPeer , Throwable throwable , String debugReason ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "invalidateConnection" , new Object [ ] { new Boolean ( notifyPeer ) , throwable , debugReason } ) ; if ( con != null ) { ConnectionInterface connection = con . getConnectionReference ( ) ; if ( connection != null ) { connection . invalidate ( notifyPeer , throwable , debugReason ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "invalidateConnection" ) ; }
Utility method to invalidate Connection . Parameters passed to ConnectionInterface . invalidate
36,926
SibRaListener createListener ( final SIDestinationAddress destination , MessageEndpointFactory messageEndpointFactory ) throws ResourceException { final String methodName = "createListener" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { destination , messageEndpointFactory } ) ; } if ( _closed ) { throw new IllegalStateException ( NLS . getString ( "LISTENER_CLOSED_CWSIV0952" ) ) ; } final SibRaListener listener ; listener = new SibRaSingleProcessListener ( this , destination , messageEndpointFactory ) ; _listeners . put ( destination , listener ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName , listener ) ; } return listener ; }
Creates a new listener to the given destination .
36,927
SibRaDispatcher createDispatcher ( final AbstractConsumerSession session , final Reliability unrecoveredReliability , final int maxFailedDeliveries , final int sequentialFailureThreshold ) throws ResourceException { final String methodName = "createDispatcher" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { session , unrecoveredReliability , maxFailedDeliveries , sequentialFailureThreshold } ) ; } if ( _closed ) { throw new IllegalStateException ( NLS . getString ( "LISTENER_CLOSED_CWSIV0953" ) ) ; } final SibRaDispatcher dispatcher ; if ( _endpointActivation . isEndpointMethodTransactional ( ) ) { if ( _endpointConfiguration . getShareDataSourceWithCMP ( ) ) { dispatcher = new SibRaSynchronizedDispatcher ( this , session , _endpointActivation , unrecoveredReliability , maxFailedDeliveries , sequentialFailureThreshold ) ; } else { dispatcher = new SibRaTransactionalDispatcher ( this , session , _endpointActivation , _busName , unrecoveredReliability , maxFailedDeliveries , sequentialFailureThreshold ) ; } } else { if ( SibRaMessageDeletionMode . BATCH . equals ( _endpointConfiguration . getMessageDeletionMode ( ) ) ) { dispatcher = new SibRaBatchMessageDeletionDispatcher ( this , session , _endpointActivation , unrecoveredReliability , maxFailedDeliveries , sequentialFailureThreshold ) ; } else if ( SibRaMessageDeletionMode . SINGLE . equals ( _endpointConfiguration . getMessageDeletionMode ( ) ) ) { dispatcher = new SibRaSingleMessageDeletionDispatcher ( this , session , _endpointActivation , unrecoveredReliability , maxFailedDeliveries , sequentialFailureThreshold ) ; } else { dispatcher = new SibRaNonTransactionalDispatcher ( this , session , _endpointActivation , unrecoveredReliability , maxFailedDeliveries , sequentialFailureThreshold ) ; } } _dispatcherCount . incrementAndGet ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "Creating a dispatcher, there are now " + _dispatcherCount . get ( ) + " open dispatchers" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName , dispatcher ) ; } return dispatcher ; }
Gets a dispatcher for the given session and messages .
36,928
void closeDispatcher ( final SibRaDispatcher dispatcher ) { final String methodName = "closeDispatcher" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } dispatcher . close ( ) ; _dispatcherCount . decrementAndGet ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "Removing a dispatcher - there are " + _dispatcherCount . get ( ) + " left" ) ; } synchronized ( _dispatcherCount ) { _dispatcherCount . notifyAll ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
Closes the given dispatcher .
36,929
void close ( ) { final String methodName = "close" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } close ( false ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
Closes the connection and any associated listeners and dispatchers
36,930
void close ( boolean alreadyClosed ) { final String methodName = "close" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , alreadyClosed ) ; } _closed = true ; if ( ! alreadyClosed ) { for ( final Iterator iterator = _listeners . values ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { final SibRaListener listener = ( SibRaListener ) iterator . next ( ) ; listener . stop ( ) ; } } SibRaDispatcher . resetMEName ( ) ; synchronized ( _dispatcherCount ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "There are still " + _dispatcherCount . get ( ) + " open dispatchers" ) ; } if ( _dispatcherCount . get ( ) > 0 ) { Long mdbQuiescingTimeout = getMDBQuiescingTimeoutProperty ( ) ; waitForDispatchersToFinish ( mdbQuiescingTimeout ) ; } } if ( ! alreadyClosed ) { for ( final Iterator iterator = _listeners . values ( ) . iterator ( ) ; iterator . hasNext ( ) ; ) { final SibRaListener listener = ( SibRaListener ) iterator . next ( ) ; listener . close ( ) ; } } _listeners . clear ( ) ; try { _connection . removeConnectionListener ( _connectionListener ) ; if ( ! alreadyClosed ) { _connection . close ( ) ; } } catch ( final SIException exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , "1:1023:1.59" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } } catch ( final SIErrorException exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , "1:1031:1.59" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
Closes this connection and any associated listeners and dispatchers .
36,931
SICoreConnection createConnection ( SICoreConnectionFactory factory , String name , String password , Map properties , String busName ) throws SIException , SIErrorException , Exception { final String methodName = "createConnection" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName , new Object [ ] { factory , name , "password not traced" , properties , busName } ) ; } SICoreConnection result ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "Creating connection with Userid and password" ) ; } result = factory . createConnection ( name , password , properties ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "createConnection" , result ) ; } return result ; }
Creates this connection using either the Auth Alias supplied or if the property is set the WAS server subject .
36,932
private String getUnavailableServices ( ) { StringBuilder missingServices = new StringBuilder ( ) ; if ( tokenService . getReference ( ) == null ) { missingServices . append ( "tokenService, " ) ; } if ( tokenManager . getReference ( ) == null ) { missingServices . append ( "tokenManager, " ) ; } if ( authenticationService . getReference ( ) == null ) { missingServices . append ( "authenticationService, " ) ; } if ( authorizationService . getReference ( ) == null ) { missingServices . append ( "authorizationService, " ) ; } if ( userRegistry . getReference ( ) == null ) { missingServices . append ( "userRegistry, " ) ; } if ( userRegistryService . getReference ( ) == null ) { missingServices . append ( "userRegistryService, " ) ; } if ( missingServices . length ( ) == 0 ) { return null ; } else { return missingServices . substring ( 0 , missingServices . length ( ) - 2 ) ; } }
Construct a String that lists all of the missing services . This is very useful for debugging .
36,933
private void updateSecurityReadyState ( ) { if ( ! activated ) { return ; } String unavailableServices = getUnavailableServices ( ) ; if ( unavailableServices == null ) { Tr . info ( tc , "SECURITY_SERVICE_READY" ) ; securityReady = true ; Dictionary < String , Object > props = new Hashtable < String , Object > ( ) ; props . put ( "service.vendor" , "IBM" ) ; reg = cc . getBundleContext ( ) . registerService ( SecurityReadyService . class , this , props ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "The following required security services are not available: " + unavailableServices ) ; } securityReady = false ; if ( reg != null ) { reg . unregister ( ) ; reg = null ; } } }
Security is ready when all of these required services have been registered .
36,934
private void parseDirectoryFiles ( WsResource directory , ServerConfiguration configuration ) throws ConfigParserException , ConfigValidationException { if ( directory != null ) { File [ ] defaultFiles = getChildXMLFiles ( directory ) ; if ( defaultFiles == null ) return ; Arrays . sort ( defaultFiles , new AlphaComparator ( ) ) ; for ( int i = 0 ; i < defaultFiles . length ; i ++ ) { File file = defaultFiles [ i ] ; if ( ! file . isFile ( ) ) continue ; WsResource defaultFile = directory . resolveRelative ( file . getName ( ) ) ; if ( defaultFile == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , file . getName ( ) + " was not found in directory " + directory . getName ( ) + ". Ignoring. " ) ; } continue ; } Tr . audit ( tc , "audit.dropin.being.processed" , defaultFile . asFile ( ) ) ; try { parser . parseServerConfiguration ( defaultFile , configuration ) ; } catch ( ConfigParserException ex ) { parser . handleParseError ( ex , null ) ; if ( ErrorHandler . INSTANCE . fail ( ) ) { throw ex ; } else { configuration . updateLastModified ( configRoot . getLastModified ( ) ) ; } } } } }
Parse all of the config files in a directory in platform insensitive alphabetical order
36,935
public ServletContext findContext ( String path ) { WebGroup g = ( WebGroup ) requestMapper . map ( path ) ; if ( g != null ) return g . getContext ( ) ; else return null ; }
Method findContext .
36,936
private void addWlpInformation ( Asset asset ) { WlpInformation wlpInfo = asset . getWlpInformation ( ) ; if ( wlpInfo == null ) { wlpInfo = new WlpInformation ( ) ; asset . setWlpInformation ( wlpInfo ) ; } if ( wlpInfo . getAppliesToFilterInfo ( ) == null ) { wlpInfo . setAppliesToFilterInfo ( new ArrayList < AppliesToFilterInfo > ( ) ) ; } }
For historic reasons when an asset is read back from the repository the wlpInformation and ATFI should always be present . This method does that .
36,937
public Discriminator getDiscriminator ( ) { if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getDiscriminator" ) ; if ( tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getDiscriminator" , discriminator ) ; return discriminator ; }
Returns the discriminator for this channel .
36,938
private Object getResult ( ) throws InterruptedException , ExecutionException { if ( ivCancelled ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getResult: throwing CancellationException" ) ; } throw new CancellationException ( ) ; } if ( ivException != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getResult: " + ivException ) ; } throw new ExecutionException ( ivException ) ; } Object resultToReturn = null ; if ( ivFuture != null ) { resultToReturn = ivFuture . get ( ) ; } return ( resultToReturn ) ; }
This get method returns the result of the async method call . This method must not be called unless ivGate indicates that results are available .
36,939
private Object getResult ( long timeout , TimeUnit unit ) throws InterruptedException , ExecutionException , TimeoutException { if ( ivCancelled ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getResult: throwing CancellationException" ) ; } throw new CancellationException ( ) ; } if ( ivException != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getResult: " + ivException ) ; } throw new ExecutionException ( ivException ) ; } Object resultToReturn = null ; if ( ivFuture != null ) { if ( ivFuture instanceof AsyncResult ) { resultToReturn = ivFuture . get ( ) ; } else { resultToReturn = ivFuture . get ( timeout , unit ) ; } } return ( resultToReturn ) ; }
This get method returns the result of the asynch method call . This method must not be called unless ivGate indicates that results are available .
36,940
public boolean isCancelled ( ) { boolean cancelled = ivCancelled ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "isCancelled: " + cancelled + " Future object: " + this ) ; } return ( cancelled ) ; }
This method allows clients to check the Future object to see if the asynch method was canceled before it got a chance to execute .
36,941
void setResult ( Future < ? > theFuture ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setResult: " + Util . identity ( theFuture ) + " Future object: " + this ) ; } ivFuture = theFuture ; done ( ) ; }
did not throw an exception .
36,942
void setException ( Throwable theException ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "setException - Future object: " + this , theException ) ; } ivException = theException ; done ( ) ; }
The async method ended with an exception
36,943
public Object saveState ( FacesContext context ) { if ( ! initialStateMarked ( ) ) { Object values [ ] = new Object [ 2 ] ; values [ 0 ] = _maximum ; values [ 1 ] = _minimum ; return values ; } return null ; }
RESTORE & SAVE STATE
36,944
public void logout ( Subject subject ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , CLASS_NAME + "logout" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , CLASS_NAME + "logout" ) ; } }
Logout method is used only for auditing purpose
36,945
public void setMessagingAuthenticationService ( MessagingAuthenticationService messagingAuthenticationService ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , CLASS_NAME + "setMessagingAuthenticationService" , messagingAuthenticationService ) ; } this . messagingAuthenticationService = messagingAuthenticationService ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , CLASS_NAME + "setMessagingAuthenticationService" ) ; } }
Set the MessagingAuthenticationService
36,946
public void deactivate ( ComponentContext cc ) throws IOException { ConfigProviderResolver . setInstance ( null ) ; shutdown ( ) ; scheduledExecutorServiceRef . deactivate ( cc ) ; }
Deactivate a context and set the instance to null
36,947
public void shutdown ( ) { synchronized ( configCache ) { Set < ClassLoader > allClassLoaders = new HashSet < > ( ) ; allClassLoaders . addAll ( configCache . keySet ( ) ) ; for ( ClassLoader classLoader : allClassLoaders ) { close ( classLoader ) ; } configCache . clear ( ) ; appClassLoaderMap . clear ( ) ; } }
Close down all the configs
36,948
private void close ( ClassLoader classLoader ) { synchronized ( configCache ) { ConfigWrapper config = configCache . remove ( classLoader ) ; if ( config != null ) { Set < String > applicationNames = config . getApplications ( ) ; for ( String app : applicationNames ) { appClassLoaderMap . remove ( app ) ; } config . close ( ) ; } } }
Completely close a config for a given classloader
36,949
private void closeConfig ( Config config ) { if ( config instanceof WebSphereConfig ) { try { ( ( WebSphereConfig ) config ) . close ( ) ; } catch ( IOException e ) { throw new ConfigException ( Tr . formatMessage ( tc , "could.not.close.CWMCG0004E" , e ) ) ; } } }
Close a given config if it s a WebSphereConfig
36,950
public SICoreConnection getSICoreConnection ( ) throws IllegalStateException { if ( connectionClosed ) { throw new IllegalStateException ( NLS . getFormattedMessage ( ( "ILLEGAL_STATE_CWSJR1086" ) , new Object [ ] { "getSICoreConnection" } , null ) ) ; } return _coreConnection ; }
Returns the core connection created for and associated with this connection .
36,951
synchronized public void close ( ) throws SIConnectionLostException , SIIncorrectCallException , SIResourceException , SIErrorException , SIConnectionDroppedException , SIConnectionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "close" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( TRACE , "We have " + _sessions . size ( ) + " left open - closing them" ) ; } for ( final Iterator iterator = _sessions . iterator ( ) ; iterator . hasNext ( ) ; ) { final Object object = iterator . next ( ) ; if ( object instanceof JmsJcaSessionImpl ) { final JmsJcaSessionImpl session = ( JmsJcaSessionImpl ) object ; session . close ( false ) ; } iterator . remove ( ) ; } if ( _coreConnection != null ) { _coreConnection . close ( ) ; } connectionClosed = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "close" ) ; } }
Closes this connection its associated core connection and any sessions created from it .
36,952
private static boolean isRunningInWAS ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( TRACE , "isRunningInWAS" ) ; } if ( inWAS == null ) { inWAS = Boolean . TRUE ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( TRACE , "isRunningInWAS" , inWAS ) ; } return inWAS . booleanValue ( ) ; }
Returns true if running in WAS . The check is to see if com . ibm . tx . jta . Transaction . TransactionManagerFactory is on the classpath .
36,953
private static final Object getCurrentUOWCoord ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( TRACE , "getCurrentUOWCoord" ) ; } Object currentUOW = null ; if ( isRunningInWAS ( ) ) { currentUOW = EmbeddableTransactionManagerFactory . getUOWCurrent ( ) . getUOWCoord ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( TRACE , "getCurrentUOWCoord" , currentUOW ) ; } return currentUOW ; }
This method uses reflection to try and obtain the current UOW if we are not inside WAS null is returned .
36,954
private PostCreateAction listenForLibraryChanges ( final String libid ) { return new PostCreateAction ( ) { public void invoke ( AppClassLoader acl ) { listenForLibraryChanges ( libid , acl ) ; } } ; }
create an action that will create a listener when invoked
36,955
private void listenForLibraryChanges ( String libid , AppClassLoader acl ) { new WeakLibraryListener ( libid , acl . getKey ( ) . getId ( ) , acl , bundleContext ) { protected void update ( ) { Object cl = get ( ) ; if ( cl instanceof AppClassLoader && aclStore != null ) aclStore . remove ( ( AppClassLoader ) cl ) ; deregister ( ) ; } } ; }
create a listener to remove a loader from the canonical store on library update
36,956
private String getTopic ( BundleEvent bundleEvent ) { StringBuilder topic = new StringBuilder ( BUNDLE_EVENT_TOPIC_PREFIX ) ; switch ( bundleEvent . getType ( ) ) { case BundleEvent . INSTALLED : topic . append ( "INSTALLED" ) ; break ; case BundleEvent . STARTED : topic . append ( "STARTED" ) ; break ; case BundleEvent . STOPPED : topic . append ( "STOPPED" ) ; break ; case BundleEvent . UPDATED : topic . append ( "UPDATED" ) ; break ; case BundleEvent . UNINSTALLED : topic . append ( "UNINSTALLED" ) ; break ; case BundleEvent . RESOLVED : topic . append ( "RESOLVED" ) ; break ; case BundleEvent . UNRESOLVED : topic . append ( "UNRESOLVED" ) ; break ; default : return null ; } return topic . toString ( ) ; }
Determine the appropriate topic to use for the Bundle Event .
36,957
public PmiDataInfo [ ] submoduleMembers ( String submoduleName , int level ) { if ( submoduleName == null ) return listLevelData ( level ) ; ArrayList returnData = new ArrayList ( ) ; boolean inCategory = false ; if ( submoduleName . startsWith ( "ejb." ) ) inCategory = true ; Iterator allData = perfData . values ( ) . iterator ( ) ; while ( allData . hasNext ( ) ) { PmiDataInfo info = ( PmiDataInfo ) allData . next ( ) ; if ( inCategory ) { if ( info . getCategory ( ) . equals ( "all" ) || isInCategory ( submoduleName , info . getCategory ( ) ) ) returnData . add ( info ) ; } else if ( info . getSubmoduleName ( ) != null && info . getSubmoduleName ( ) . equals ( submoduleName ) && info . getLevel ( ) <= level ) { returnData . add ( info ) ; } } PmiDataInfo [ ] ret = new PmiDataInfo [ returnData . size ( ) ] ; for ( int i = 0 ; i < ret . length ; i ++ ) ret [ i ] = ( PmiDataInfo ) returnData . get ( i ) ; return ret ; }
Returns an array of PmiDataInfo for the given submoduleName and level .
36,958
public PmiDataInfo [ ] listLevelData ( int level ) { ArrayList levelData = new ArrayList ( ) ; Iterator allData = perfData . values ( ) . iterator ( ) ; while ( allData . hasNext ( ) ) { PmiDataInfo dataInfo = ( PmiDataInfo ) allData . next ( ) ; if ( dataInfo . getLevel ( ) <= level ) { levelData . add ( dataInfo ) ; } } PmiDataInfo [ ] ret = new PmiDataInfo [ levelData . size ( ) ] ; for ( int i = 0 ; i < ret . length ; i ++ ) ret [ i ] = ( PmiDataInfo ) levelData . get ( i ) ; return ret ; }
Returns the statistic with level equal to or lower than level
36,959
public PmiDataInfo [ ] listMyLevelData ( int level ) { ArrayList levelData = new ArrayList ( ) ; Iterator allData = perfData . values ( ) . iterator ( ) ; while ( allData . hasNext ( ) ) { PmiDataInfo dataInfo = ( PmiDataInfo ) allData . next ( ) ; if ( dataInfo . getLevel ( ) == level ) { levelData . add ( dataInfo ) ; } } return ( PmiDataInfo [ ] ) levelData . toArray ( ) ; }
Returns the statistic with level equal to level
36,960
public int [ ] listStatisticsWithDependents ( ) { if ( dependList == null ) { ArrayList list = new ArrayList ( ) ; Iterator allData = perfData . values ( ) . iterator ( ) ; while ( allData . hasNext ( ) ) { PmiDataInfo dataInfo = ( PmiDataInfo ) allData . next ( ) ; if ( dataInfo . getDependency ( ) != null ) { list . add ( new Integer ( dataInfo . getId ( ) ) ) ; } } dependList = new int [ list . size ( ) ] ; for ( int i = 0 ; i < list . size ( ) ; i ++ ) { dependList [ i ] = ( ( Integer ) list . get ( i ) ) . intValue ( ) ; } } return dependList ; }
Returns String representation of this object
36,961
private void scheduleEvictionTask ( long timeoutInMilliSeconds ) { EvictionTask evictionTask = new EvictionTask ( ) ; SwapTCCLAction swapTCCL = new SwapTCCLAction ( ) ; AccessController . doPrivileged ( swapTCCL ) ; try { timer = new Timer ( true ) ; long period = timeoutInMilliSeconds / 3 ; long delay = period ; timer . schedule ( evictionTask , delay , period ) ; } finally { AccessController . doPrivileged ( swapTCCL ) ; } }
Creates a timer and schedules the eviction task based on the timeout in milliseconds
36,962
public synchronized Object update ( String key , Object value ) { while ( isEvictionRequired ( ) && entryLimit > 0 && entryLimit < Integer . MAX_VALUE ) { evictStaleEntries ( ) ; } CacheEntry oldEntry = null ; CacheEntry curEntry = new CacheEntry ( value ) ; if ( primaryTable . containsKey ( key ) ) { oldEntry = ( CacheEntry ) primaryTable . put ( key , curEntry ) ; } else if ( secondaryTable . containsKey ( key ) ) { oldEntry = ( CacheEntry ) secondaryTable . put ( key , curEntry ) ; } else if ( tertiaryTable . containsKey ( key ) ) { oldEntry = ( CacheEntry ) tertiaryTable . put ( key , curEntry ) ; } else { oldEntry = ( CacheEntry ) primaryTable . put ( key , curEntry ) ; } return oldEntry != null ? oldEntry . value : null ; }
Update the value into the Cache using the specified key but do not change the table level of the cache . If the key is not in any table add it to the primaryTable
36,963
public synchronized void clearAllEntries ( ) { tertiaryTable . putAll ( primaryTable ) ; tertiaryTable . putAll ( secondaryTable ) ; primaryTable . clear ( ) ; secondaryTable . clear ( ) ; evictStaleEntries ( ) ; }
Purge all entries from the Cache . Semantically this should behave the same as the expiration of all entries from the cache .
36,964
public static WebSphereBeanDeploymentArchive createBDA ( WebSphereCDIDeployment deployment , ExtensionArchive extensionArchive , CDIRuntime cdiRuntime ) throws CDIException { Set < String > additionalClasses = extensionArchive . getExtraClasses ( ) ; Set < String > additionalAnnotations = extensionArchive . getExtraBeanDefiningAnnotations ( ) ; boolean extensionCanSeeApplicationBDAs = extensionArchive . applicationBDAsVisible ( ) ; boolean extClassesOnlyBDA = extensionArchive . isExtClassesOnly ( ) ; String archiveID = deployment . getDeploymentID ( ) + "#" + extensionArchive . getName ( ) + ".additionalClasses" ; EEModuleDescriptor eeModuleDescriptor = new WebSphereEEModuleDescriptor ( archiveID , extensionArchive . getType ( ) ) ; WebSphereBeanDeploymentArchive bda = createBDA ( deployment , archiveID , extensionArchive , cdiRuntime , additionalClasses , additionalAnnotations , extensionCanSeeApplicationBDAs , extClassesOnlyBDA , eeModuleDescriptor ) ; return bda ; }
only for extensions
36,965
public void setWrapperCacheSize ( int cacheSize ) { wrapperCache . setCachePreferredMaxSize ( cacheSize ) ; int updatedCacheSize = getBeanIdCacheSize ( cacheSize ) ; beanIdCache . setSize ( updatedCacheSize ) ; }
Call to update the BeanIdCache cache size .
36,966
private int getBeanIdCacheSize ( int cacheSize ) { int beanIdCacheSize = cacheSize ; if ( beanIdCacheSize < ( Integer . MAX_VALUE / 2 ) ) beanIdCacheSize = beanIdCacheSize * 2 ; else beanIdCacheSize = Integer . MAX_VALUE ; return beanIdCacheSize ; }
Calculate the size to be used for the BeanIdCache .
36,967
public boolean unregister ( BeanId beanId , boolean dropRef ) throws CSIException { boolean removed = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "unregister" , new Object [ ] { beanId , new Boolean ( dropRef ) } ) ; ByteArray wrapperKey = beanId . getByteArray ( ) ; try { EJSWrapperCommon wrapperCommon = ( EJSWrapperCommon ) wrapperCache . removeAndDiscard ( wrapperKey , dropRef ) ; if ( wrapperCommon != null ) { removed = true ; } } catch ( IllegalOperationException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".unregister" , "351" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "unregister ignoring IllegalOperationException for object " + beanId ) ; Tr . event ( tc , "Exception: " + ex ) ; } } catch ( DiscardException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".unregister" , "358" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Unable to discard element" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "unregister" ) ; return removed ; }
d181569 - changed signature of method .
36,968
public void unregisterHome ( J2EEName homeName , EJSHome homeObj ) throws CSIException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "unregisterHome" ) ; J2EEName cacheHomeName ; int numEnumerated = 0 , numRemoved = 0 ; Enumeration < ? > enumerate = wrapperCache . enumerateElements ( ) ; while ( enumerate . hasMoreElements ( ) ) { EJSWrapperCommon wCommon = ( EJSWrapperCommon ) ( ( CacheElement ) enumerate . nextElement ( ) ) . getObject ( ) ; BeanId cacheMemberBeanId = wCommon . getBeanId ( ) ; cacheHomeName = cacheMemberBeanId . getJ2EEName ( ) ; numEnumerated ++ ; if ( cacheHomeName . equals ( homeName ) || cacheMemberBeanId . equals ( homeObj . getId ( ) ) ) { unregister ( cacheMemberBeanId , true ) ; numRemoved ++ ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unregistered " + numRemoved + " wrappers (total = " + numEnumerated + ")" ) ; } beanIdCache . removeAll ( homeObj ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "unregisterHome" ) ; }
unregisterHome removes from cache homeObj and all Objects that have homeObj as it s home . It also unregisters these objects from from the orb object adapter .
36,969
public void discardObject ( EJBCache wrapperCache , Object key , Object ele ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "discardObject" , new Object [ ] { key , ele } ) ; EJSWrapperCommon wrapperCommon = ( EJSWrapperCommon ) ele ; wrapperCommon . disconnect ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "discardObject" ) ; }
Unregister a wrapper instance when it is castout of the wrapper cache .
36,970
public Object faultOnKey ( EJBCache cache , Object key ) throws FaultException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "faultOnKey" , key ) ; ByteArray wrapperKey = ( ByteArray ) key ; EJSWrapperCommon result = null ; BeanId beanId = wrapperKey . getBeanId ( ) ; try { if ( beanId == null ) { beanId = BeanId . getBeanId ( wrapperKey , container ) ; } result = container . createWrapper ( beanId ) ; } catch ( InvalidBeanIdException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".faultOnKey" , "533" , this ) ; Throwable cause = ex . getCause ( ) ; if ( cause instanceof EJBNotFoundException ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Application Not Started" , ex ) ; throw new FaultException ( ( EJBNotFoundException ) cause , "Application not started or not installed" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Malformed object key" , ex ) ; throw new FaultException ( ex , "Malformed object key" ) ; } catch ( Exception ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".faultOnKey" , "548" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "Malformed object key" , ex ) ; throw new FaultException ( ex , "Malformed object key" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "faultOnKey" ) ; return result ; }
Invoked by the Cache FaultStrategy when an object was not found and needs to be inserted . We create a new wrapper instance to be inserted into the cache . The cache package holds the lock on a bucket when this method is invoked .
36,971
public boolean isValid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Checking validity of token " + this . getClass ( ) . getName ( ) ) ; if ( token != null ) { long currentTime = System . currentTimeMillis ( ) ; long expiration = getExpiration ( ) ; long timeleft = expiration - currentTime ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Time left for token: " + timeleft ) ; if ( timeleft > 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "token is valid." ) ; return true ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "token is invalid." ) ; return false ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "token is null, returning invalid." ) ; return false ; } }
Validates the token including expiration signature etc .
36,972
public String getPrincipal ( ) { String [ ] accessIDArray = getAttributes ( "u" ) ; if ( accessIDArray != null && accessIDArray . length > 0 ) return accessIDArray [ 0 ] ; else return null ; }
Gets the principal that this Token belongs to . If this is an authorization token this principal string must match the authentication token principal string or the message will be rejected .
36,973
public String getUniqueID ( ) { String [ ] cacheKeyArray = getAttributes ( AttributeNameConstants . WSCREDENTIAL_CACHE_KEY ) ; if ( cacheKeyArray != null && cacheKeyArray [ 0 ] != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Found cache key in Authz token: " + cacheKeyArray [ 0 ] ) ; return cacheKeyArray [ 0 ] ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "No unique cache key found in token." ) ; return null ; }
Returns a unique identifier of the token based upon information the provider considers makes this a unique token . This will be used for caching purposes and may be used in combination with other token unique IDs that are part of the same Subject .
36,974
public String [ ] getAttributes ( String key ) { if ( token != null ) return token . getAttributes ( key ) ; else return null ; }
Gets the attribute value based on the named value .
36,975
public long getMaximumTimeInStore ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMaximumTimeInStore" ) ; long maxTime = getMessageItem ( ) . getMaximumTimeInStore ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMaximumTimeInStore" , new Long ( maxTime ) ) ; return maxTime ; }
Return the maximum time this reference should spend in a ReferenceStream .
36,976
private void resetEvents ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "resetEvents" ) ; PRE_COMMIT_ADD = null ; PRE_COMMIT_REMOVE = null ; POST_COMMIT_ADD_1 = null ; POST_COMMIT_ADD_2 = null ; POST_COMMIT_REMOVE_1 = null ; POST_COMMIT_REMOVE_2 = null ; POST_COMMIT_REMOVE_3 = null ; POST_COMMIT_REMOVE_4 = null ; POST_ROLLBACK_ADD_1 = null ; POST_ROLLBACK_ADD_2 = null ; POST_ROLLBACK_REMOVE_1 = null ; POST_ROLLBACK_REMOVE_2 = null ; POST_ROLLBACK_REMOVE_3 = null ; POST_ROLLBACK_REMOVE_4 = null ; UNLOCKED_1 = null ; UNLOCKED_2 = null ; UNLOCKED_3 = null ; PRE_UNLOCKED_1 = null ; PRE_UNLOCKED_2 = null ; REFERENCES_DROPPED_TO_ZERO = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "resetEvents" ) ; }
Reset all callbacks to null .
36,977
public SIBUuid12 getProducerConnectionUuid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getProducerConnectionUuid" ) ; SibTr . exit ( tc , "getProducerConnectionUuid" ) ; } return getMessageItem ( ) . getProducerConnectionUuid ( ) ; }
Returns the producerConnectionUuid .
36,978
private MessageItem getMessageItem ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMessageItem" ) ; MessageItem msg = null ; try { msg = ( MessageItem ) getReferredItem ( ) ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.items.MessageItemReference.getMessageItem" , "1:857:1.147" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMessageItem" , e ) ; throw new SIErrorException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMessageItem" , msg ) ; return msg ; }
Returns the referenced message item
36,979
public static void setTextInfoTranslationEnabled ( boolean textInfoTranslationEnabled , Locale locale ) { com . ibm . ws . pmi . stat . StatsImpl . setEnableNLS ( textInfoTranslationEnabled , locale ) ; }
This method allows translation of the textual information . By default translation is enabled using the default Locale .
36,980
private final static void ELCheckType ( final Object obj , final Class < ? > type ) throws ELException { if ( String . class . equals ( type ) ) { ELSupport . coerceToString ( obj ) ; } if ( ELArithmetic . isNumberType ( type ) ) { ELSupport . coerceToNumber ( obj , type ) ; } if ( Character . class . equals ( type ) || Character . TYPE == type ) { ELSupport . coerceToCharacter ( obj ) ; } if ( Boolean . class . equals ( type ) || Boolean . TYPE == type ) { ELSupport . coerceToBoolean ( obj ) ; } if ( type . isEnum ( ) ) { ELSupport . coerceToEnum ( obj , type ) ; } }
method used to replace ELSupport . checkType
36,981
public static String getProductVersion ( RepositoryResource installResource ) { String resourceVersion = null ; try { Collection < ProductDefinition > pdList = new ArrayList < ProductDefinition > ( ) ; for ( ProductInfo pi : ProductInfo . getAllProductInfo ( ) . values ( ) ) { pdList . add ( new ProductInfoProductDefinition ( pi ) ) ; } resourceVersion = installResource . getAppliesToVersions ( pdList ) ; } catch ( Exception e ) { logger . log ( Level . FINEST , e . getMessage ( ) , e ) ; } if ( resourceVersion == null ) resourceVersion = InstallConstants . NOVERSION ; return resourceVersion ; }
Gets the version of the resource using the getAppliesToVersions function .
36,982
public static boolean isPublicAsset ( ResourceType resourceType , RepositoryResource installResource ) { if ( resourceType . equals ( ResourceType . FEATURE ) || resourceType . equals ( ResourceType . ADDON ) ) { EsaResource esar = ( ( EsaResource ) installResource ) ; if ( esar . getVisibility ( ) . equals ( Visibility . PUBLIC ) || esar . getVisibility ( ) . equals ( Visibility . INSTALL ) ) { return true ; } } else if ( resourceType . equals ( ResourceType . PRODUCTSAMPLE ) || resourceType . equals ( ResourceType . OPENSOURCE ) ) { return true ; } return false ; }
Checks if Feature or Addon has visibility public or install OR checks if the resource is a Product sample or open source to see if it is a public asset .
36,983
public static Map < String , Collection < String > > writeResourcesToDiskRepo ( Map < String , Collection < String > > downloaded , File toDir , Map < String , List < List < RepositoryResource > > > installResources , String productVersion , EventManager eventManager , boolean defaultRepo ) throws InstallException { int progress = 10 ; int interval1 = installResources . size ( ) == 0 ? 90 : 90 / installResources . size ( ) ; for ( List < List < RepositoryResource > > targetList : installResources . values ( ) ) { for ( List < RepositoryResource > mrList : targetList ) { int interval2 = mrList . size ( ) == 0 ? interval1 : interval1 / mrList . size ( ) ; for ( RepositoryResource installResource : mrList ) { try { writeResourcesToDiskRepo ( downloaded , toDir , installResource , eventManager , progress += interval2 ) ; } catch ( InstallException e ) { throw e ; } catch ( Exception e ) { throw ExceptionUtils . createFailedToDownload ( installResource , e , toDir ) ; } } } } return downloaded ; }
The function writes the resources to the downloaded disk repo
36,984
@ Reference ( cardinality = ReferenceCardinality . MULTIPLE ) protected void setJaasLoginModuleConfig ( JAASLoginModuleConfig lmc , Map < String , Object > props ) { String pid = ( String ) props . get ( KEY_SERVICE_PID ) ; loginModuleMap . put ( pid , lmc ) ; }
SINCE THIS IS A STATIC REFERENCE DS provides enough synchronization so that we don t need to synchronize on the map .
36,985
public void init ( HttpInboundServiceContext context ) { this . message = context . getRequest ( ) ; if ( this . useEE7Streams ) { this . body = new HttpInputStreamEE7 ( context ) ; } else { this . body = new HttpInputStreamImpl ( context ) ; } }
Initialize with a new connection .
36,986
public static Metadata < Extension > loadExtension ( String extensionClass , ClassLoader classloader ) { Class < ? extends Extension > serviceClass = loadClass ( Extension . class , extensionClass , classloader ) ; if ( serviceClass == null ) { return null ; } Extension serviceInstance = prepareInstance ( serviceClass ) ; if ( serviceInstance == null ) { return null ; } return new MetadataImpl < Extension > ( serviceInstance , extensionClass ) ; }
Create the extension and return a metadata for the extension
36,987
public static < S > Class < ? extends S > loadClass ( Class < S > expectedType , String serviceClassName , ClassLoader classloader ) { Class < ? > clazz = null ; Class < ? extends S > serviceClass = null ; try { clazz = classloader . loadClass ( serviceClassName ) ; serviceClass = clazz . asSubclass ( expectedType ) ; } catch ( ResourceLoadingException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "loadClass()" , e ) ; } } catch ( ClassCastException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "loadClass()" , e ) ; } } catch ( ClassNotFoundException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "loadClass()" , e ) ; } } return serviceClass ; }
load the class and then casts to the specified sub class
36,988
public static < S > S prepareInstance ( Class < ? extends S > serviceClass ) { try { final Constructor < ? extends S > constructor = serviceClass . getDeclaredConstructor ( ) ; AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { public Void run ( ) { constructor . setAccessible ( true ) ; return null ; } } ) ; return constructor . newInstance ( ) ; } catch ( LinkageError e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): Could not instantiate service class " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( InvocationTargetException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( InstantiationException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( IllegalAccessException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( SecurityException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } catch ( NoSuchMethodException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "prepareInstance(): The exception happened on loading " + serviceClass . getName ( ) , e ) ; } return null ; } }
Creates an object of the service class
36,989
private static boolean isVisible ( ClassLoader loaderA , ClassLoader loaderB ) { if ( loaderB == loaderA || loaderB . getParent ( ) == loaderA ) { return true ; } return false ; }
return true if loaderA is visible to loaderB
36,990
public static ClassLoader getAndSetLoader ( ClassLoader newCL ) { ThreadContextAccessor tca = ThreadContextAccessor . getThreadContextAccessor ( ) ; Object maybeOldCL = tca . pushContextClassLoaderForUnprivileged ( newCL ) ; if ( maybeOldCL instanceof ClassLoader ) { return ( ClassLoader ) maybeOldCL ; } else { return newCL ; } }
This method sets the thread context classloader and returns whatever was the TCCL before it was updated .
36,991
public static boolean isWeldProxy ( Object obj ) { Class < ? > clazz = obj . getClass ( ) ; boolean result = isWeldProxy ( clazz ) ; return result ; }
Return whether the object is a weld proxy
36,992
public < T > void aroundInject ( final InjectionContext < T > injectionContext ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Annotations: " + injectionContext . getAnnotatedType ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Perform EE injection." ) ; } injectJavaEEResources ( injectionContext ) ; AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { public Void run ( ) { injectionContext . proceed ( ) ; return null ; } } ) ; }
Perform Injection . For EE
36,993
public void readSet ( int requestNumber , SIMessageHandle [ ] msgHandles ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readSet" , new Object [ ] { requestNumber , msgHandles } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Request to read " + msgHandles . length + " message(s)" ) ; final ConversationState convState = ( ConversationState ) getConversation ( ) . getAttachment ( ) ; try { SIBusMessage [ ] messages = bifSession . readSet ( msgHandles ) ; CommsServerByteBuffer buff = poolManager . allocate ( ) ; buff . putInt ( messages . length ) ; for ( int x = 0 ; x < messages . length ; x ++ ) { buff . putMessage ( ( JsMessage ) messages [ x ] , convState . getCommsConnection ( ) , getConversation ( ) ) ; } try { getConversation ( ) . send ( buff , JFapChannelConstants . SEG_READ_SET_R , requestNumber , JFapChannelConstants . PRIORITY_MEDIUM , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".readSet" , CommsConstants . CATBIFCONSUMER_READSET_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2033" , e ) ; } } catch ( Exception e ) { if ( ! ( e instanceof SIException ) || ! convState . hasMETerminated ( ) ) { FFDCFilter . processException ( e , CLASS_NAME + ".readSet" , CommsConstants . CATBIFCONSUMER_READSET_02 , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; StaticCATHelper . sendExceptionToClient ( e , CommsConstants . CATBIFCONSUMER_READSET_02 , getConversation ( ) , requestNumber ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "readSet" ) ; }
This method will return a set of messages currently locked by the messaging engine .
36,994
public void readAndDeleteSet ( int requestNumber , SIMessageHandle [ ] msgHandles , int tran ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readAndDeleteSet" , new Object [ ] { requestNumber , msgHandles , tran } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Request to read / delete " + msgHandles . length + " message(s)" ) ; final ConversationState convState = ( ConversationState ) getConversation ( ) . getAttachment ( ) ; try { SITransaction siTran = null ; if ( tran != CommsConstants . NO_TRANSACTION ) { siTran = ( ( ServerLinkLevelState ) getConversation ( ) . getLinkLevelAttachment ( ) ) . getTransactionTable ( ) . get ( tran ) ; } SIBusMessage [ ] messages ; if ( siTran != IdToTransactionTable . INVALID_TRANSACTION ) { messages = bifSession . readAndDeleteSet ( msgHandles , siTran ) ; } else { messages = new SIBusMessage [ 0 ] ; } CommsServerByteBuffer buff = poolManager . allocate ( ) ; buff . putInt ( messages . length ) ; for ( int x = 0 ; x < messages . length ; x ++ ) { buff . putMessage ( ( JsMessage ) messages [ x ] , convState . getCommsConnection ( ) , getConversation ( ) ) ; } try { getConversation ( ) . send ( buff , JFapChannelConstants . SEG_READ_AND_DELETE_SET_R , requestNumber , JFapChannelConstants . PRIORITY_MEDIUM , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".readAndDeleteSet" , CommsConstants . CATBIFCONSUMER_READANDDELTESET_01 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2033" , e ) ; } } catch ( Exception e ) { if ( ! ( e instanceof SIException ) || ! convState . hasMETerminated ( ) ) { FFDCFilter . processException ( e , CLASS_NAME + ".readAndDeleteSet" , CommsConstants . CATBIFCONSUMER_READANDDELTESET_02 , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; StaticCATHelper . sendExceptionToClient ( e , CommsConstants . CATBIFCONSUMER_READANDDELTESET_02 , getConversation ( ) , requestNumber ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "readAndDeleteSet" ) ; }
This method will return and delete a set of messages currently locked by the messaging engine .
36,995
public String getCodeSource ( ProtectionDomain pd ) { CodeSource cs = pd . getCodeSource ( ) ; String csStr = null ; if ( cs == null ) { csStr = "null code source" ; } else { URL url = cs . getLocation ( ) ; if ( url == null ) { csStr = "null code URL" ; } else { csStr = url . toString ( ) ; } } return csStr ; }
Find the code source based on the protection domain
36,996
public String permissionToString ( java . security . CodeSource cs , ClassLoader classloaderClass , PermissionCollection col ) { StringBuffer buf = new StringBuffer ( "ClassLoader: " ) ; if ( classloaderClass == null ) { buf . append ( "Primordial Classloader" ) ; } else { buf . append ( classloaderClass . getClass ( ) . getName ( ) ) ; } buf . append ( lineSep ) ; buf . append ( " Permissions granted to CodeSource " ) . append ( cs ) . append ( lineSep ) ; if ( col != null ) { Enumeration < Permission > e = col . elements ( ) ; buf . append ( " {" ) . append ( lineSep ) ; while ( e . hasMoreElements ( ) ) { Permission p = e . nextElement ( ) ; buf . append ( " " ) . append ( p . toString ( ) ) . append ( ";" ) . append ( lineSep ) ; } buf . append ( " }" ) ; } else { buf . append ( " {" ) . append ( lineSep ) . append ( " }" ) ; } return buf . toString ( ) ; }
Print out permissions granted to a CodeSource .
36,997
boolean isOffendingClass ( Class < ? > [ ] classes , int j , ProtectionDomain pd2 , Permission inPerm ) { return ( ! classes [ j ] . getName ( ) . startsWith ( "java" ) ) && ( classes [ j ] . getName ( ) . indexOf ( "com.ibm.ws.kernel.launch.internal.NoRethrowSecurityManager" ) == - 1 ) && ( classes [ j ] . getName ( ) . indexOf ( "ClassLoader" ) == - 1 ) && ( ( j == classes . length - 1 ) ? true : ( classes [ j + 1 ] . getName ( ) . indexOf ( "ClassLoader" ) == - 1 ) ) && ! pd2 . implies ( inPerm ) ; }
isOffendingClass determines the offending class from the classes defined in the stack .
36,998
protected void cleanup ( ) { final String methodName = "cleanup" ; if ( TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } super . cleanup ( ) ; if ( _successfulMessages . size ( ) > 0 ) { try { deleteMessages ( getMessageHandles ( _successfulMessages ) , null ) ; } catch ( final ResourceException exception ) { FFDCFilter . processException ( exception , CLASS_NAME + "." + methodName , FFDC_PROBE_1 , this ) ; if ( TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } } finally { _successfulMessages . clear ( ) ; } } if ( TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName ) ; } }
Invoked after all messages in the batch have been delivered . Deletes any successful messages .
36,999
public String getContextName ( ) { ExternalContext ctx = _MyFacesExternalContextHelper . firstInstance . get ( ) ; if ( ctx == null ) { throw new UnsupportedOperationException ( ) ; } return ctx . getContextName ( ) ; }
Returns the name of the underlying context