idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
24,700
public String getRemoteEngineUuid ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getRemoteEngineUuid" ) ; String remoteUUID = _aiStream . getAnycastInputHandler ( ) . getLocalisationUuid ( ) . toString ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getRemoteEngineUuid" , remoteUUID ) ; return remoteUUID ; }
Return the Messaging engine that this request has been generated against
24,701
private static long getIPAddress ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getIPAddress" ) ; int lower32Bits = 0 ; try { final byte [ ] address = AccessController . doPrivileged ( new PrivilegedExceptionAction < byte [ ] > ( ) { public byte [ ] run ( ) throws UnknownHostException { return java . net . InetAddress . getLocalHost ( ) . getAddress ( ) ; } } ) ; lower32Bits = ( ( address [ 0 ] & 0xFF ) << 24 ) | ( ( address [ 1 ] & 0xFF ) << 16 ) | ( ( address [ 2 ] & 0xFF ) << 8 ) | ( ( address [ 3 ] & 0xFF ) << 0 ) ; } catch ( PrivilegedActionException paex ) { com . ibm . ws . ffdc . FFDCFilter . processException ( paex . getCause ( ) , "com.ibm.ws.util.UUID.getIPAddress" , "794" ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Exception caught getting host address." , paex . getCause ( ) ) ; lower32Bits = new java . util . Random ( ) . nextInt ( ) ; } catch ( Exception e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.ws.util.UUID.getIPAddress" , "661" ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Exception caught getting host address." , e ) ; lower32Bits = new java . util . Random ( ) . nextInt ( ) ; } final long ipAddress = lower32Bits & 0x00000000FFFFFFFFL ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getIPAddress" , Long . valueOf ( ipAddress ) ) ; return ipAddress ; }
return value when the IP address is 9 . 20 . 217 . 12
24,702
public boolean isMandatory ( String propName ) { if ( mandatoryProperties == null ) { setMandatoryPropertyNames ( ) ; } if ( mandatoryProperties . contains ( propName ) ) { return true ; } else { return false ; } }
Returns true if the provided property is a mandatory property ; false otherwise .
24,703
public boolean isPersistentProperty ( String propName ) { if ( transientProperties == null ) { setTransientPropertyNames ( ) ; } if ( transientProperties . contains ( propName ) ) { return false ; } else { return true ; } }
Returns true if the provided property is a persistent property ; false otherwise .
24,704
public static Class < ? > loadClass ( String name , ClassLoader callerClassLoader ) throws ClassNotFoundException { Class < ? > clazz = null ; try { ClassLoader loader = getContextClassLoader ( ) ; if ( loader != null ) { clazz = loader . loadClass ( name ) ; } } catch ( ClassNotFoundException e ) { } if ( clazz == null ) { if ( callerClassLoader != null ) { clazz = callerClassLoader . loadClass ( name ) ; } else { clazz = Class . forName ( name ) ; } } return clazz ; }
Loads the class with the specified name . For Java 2 callers the current thread s context class loader is preferred falling back on the class loader of the caller when the current thread s context is not set or the caller is pre Java 2 . If the callerClassLoader is null then fall back on the system class loader .
24,705
public static URL getResource ( String name , ClassLoader callerClassLoader ) { _checkResourceName ( name ) ; URL url = null ; ClassLoader loader = getContextClassLoader ( ) ; if ( loader != null ) { url = loader . getResource ( name ) ; } if ( url == null ) { if ( callerClassLoader != null ) { url = callerClassLoader . getResource ( name ) ; } else { url = ClassLoader . getSystemResource ( name ) ; } } return url ; }
Locates the resource with the specified name . For Java 2 callers the current thread s context class loader is preferred falling back on the class loader of the caller when the current thread s context is not set or the caller is pre Java 2 . If the callerClassLoader is null then fall back on the system class loader .
24,706
public static InputStream getResourceAsStream ( String name , ClassLoader callerClassLoader ) { _checkResourceName ( name ) ; InputStream stream = null ; ClassLoader loader = getContextClassLoader ( ) ; if ( loader != null ) { stream = loader . getResourceAsStream ( name ) ; } if ( stream == null ) { if ( callerClassLoader != null ) { stream = callerClassLoader . getResourceAsStream ( name ) ; } else { stream = ClassLoader . getSystemResourceAsStream ( name ) ; } } return stream ; }
Locates the resource stream with the specified name . For Java 2 callers the current thread s context class loader is preferred falling back on the class loader of the caller when the current thread s context is not set or the caller is pre Java 2 . If the callerClassLoader is null then fall back on the system class loader .
24,707
public Serializer writeNumber ( Number value ) throws IOException { if ( null == value ) return writeNull ( ) ; if ( value instanceof Float ) { if ( ( ( Float ) value ) . isNaN ( ) ) return writeNull ( ) ; if ( Float . NEGATIVE_INFINITY == value . floatValue ( ) ) return writeNull ( ) ; if ( Float . POSITIVE_INFINITY == value . floatValue ( ) ) return writeNull ( ) ; } if ( value instanceof Double ) { if ( ( ( Double ) value ) . isNaN ( ) ) return writeNull ( ) ; if ( Double . NEGATIVE_INFINITY == value . doubleValue ( ) ) return writeNull ( ) ; if ( Double . POSITIVE_INFINITY == value . doubleValue ( ) ) return writeNull ( ) ; } writeRawString ( value . toString ( ) ) ; return this ; }
Method to write a number to the current writer .
24,708
public Serializer writeBoolean ( Boolean value ) throws IOException { if ( null == value ) return writeNull ( ) ; writeRawString ( value . toString ( ) ) ; return this ; }
Method to write a boolean value to the output stream .
24,709
private String rightAlignedZero ( String s , int len ) { if ( len == s . length ( ) ) return s ; StringBuffer sb = new StringBuffer ( s ) ; while ( sb . length ( ) < len ) { sb . insert ( 0 , '0' ) ; } return sb . toString ( ) ; }
Method to generate a string with a particular width . Alignment is done using zeroes if it does not meet the width requirements .
24,710
public Serializer writeString ( String value ) throws IOException { if ( null == value ) return writeNull ( ) ; writer . write ( '"' ) ; char [ ] chars = value . toCharArray ( ) ; for ( int i = 0 ; i < chars . length ; i ++ ) { char c = chars [ i ] ; switch ( c ) { case '"' : writer . write ( "\\\"" ) ; break ; case '\\' : writer . write ( "\\\\" ) ; break ; case 0 : writer . write ( "\\u0000" ) ; break ; case '\b' : writer . write ( "\\b" ) ; break ; case '\t' : writer . write ( "\\t" ) ; break ; case '\n' : writer . write ( "\\n" ) ; break ; case '\f' : writer . write ( "\\f" ) ; break ; case '\r' : writer . write ( "\\r" ) ; break ; case '/' : writer . write ( "\\/" ) ; break ; default : if ( ( c >= 32 ) && ( c <= 126 ) ) { writer . write ( c ) ; } else { writer . write ( "\\u" ) ; writer . write ( rightAlignedZero ( Integer . toHexString ( c ) , 4 ) ) ; } } } writer . write ( '"' ) ; return this ; }
Method to write a String out to the writer encoding special characters and unicode characters properly .
24,711
private Serializer write ( Object object ) throws IOException { if ( null == object ) return writeNull ( ) ; if ( object instanceof Number ) return writeNumber ( ( Number ) object ) ; if ( object instanceof String ) return writeString ( ( String ) object ) ; if ( object instanceof Boolean ) return writeBoolean ( ( Boolean ) object ) ; if ( object instanceof JSONObject ) return writeObject ( ( JSONObject ) object ) ; if ( object instanceof JSONArray ) return writeArray ( ( JSONArray ) object ) ; throw new IOException ( "Attempting to serialize unserializable object: '" + object + "'" ) ; }
Method to write out a generic JSON type .
24,712
public Serializer writeObject ( JSONObject object ) throws IOException { if ( null == object ) return writeNull ( ) ; writeRawString ( "{" ) ; indentPush ( ) ; Iterator iter = null ; if ( object instanceof OrderedJSONObject ) { iter = ( ( OrderedJSONObject ) object ) . getOrder ( ) ; } else { List propertyNames = getPropertyNames ( object ) ; iter = propertyNames . iterator ( ) ; } while ( iter . hasNext ( ) ) { Object key = iter . next ( ) ; if ( ! ( key instanceof String ) ) throw new IOException ( "attempting to serialize object with an invalid property name: '" + key + "'" ) ; Object value = object . get ( key ) ; if ( ! JSONObject . isValidObject ( value ) ) throw new IOException ( "attempting to serialize object with an invalid property value: '" + value + "'" ) ; newLine ( ) ; indent ( ) ; writeString ( ( String ) key ) ; writeRawString ( ":" ) ; space ( ) ; write ( value ) ; if ( iter . hasNext ( ) ) writeRawString ( "," ) ; } indentPop ( ) ; newLine ( ) ; indent ( ) ; writeRawString ( "}" ) ; return this ; }
Method to write a complete JSON object to the stream .
24,713
public Serializer writeArray ( JSONArray value ) throws IOException { if ( null == value ) return writeNull ( ) ; writeRawString ( "[" ) ; indentPush ( ) ; for ( Iterator iter = value . iterator ( ) ; iter . hasNext ( ) ; ) { Object element = iter . next ( ) ; if ( ! JSONObject . isValidObject ( element ) ) throw new IOException ( "attempting to serialize array with an invalid element: '" + value + "'" ) ; newLine ( ) ; indent ( ) ; write ( element ) ; if ( iter . hasNext ( ) ) writeRawString ( "," ) ; } indentPop ( ) ; newLine ( ) ; indent ( ) ; writeRawString ( "]" ) ; return this ; }
Method to write a JSON array out to the stream .
24,714
public void getUsersForGroup ( List < String > grpMbrAttrs , int countLimit ) throws WIMException { String securityName = null ; try { securityName = getSecurityName ( false ) ; List < String > returnNames = urBridge . getUsersForGroup ( securityName , countLimit ) . getList ( ) ; for ( int j = 0 ; j < returnNames . size ( ) ; j ++ ) { Root fakeRoot = new Root ( ) ; PersonAccount memberDO = new PersonAccount ( ) ; fakeRoot . getEntities ( ) . add ( memberDO ) ; IdentifierType identifier = new IdentifierType ( ) ; memberDO . setIdentifier ( identifier ) ; URBridgeEntityFactory osFactory = new URBridgeEntityFactory ( ) ; URBridgeEntity osEntity = osFactory . createObject ( memberDO , urBridge , attrMap , baseEntryName , entityConfigMap ) ; osEntity . setSecurityNameProp ( returnNames . get ( j ) ) ; osEntity . populateEntity ( grpMbrAttrs ) ; osEntity . setRDNPropValue ( returnNames . get ( j ) ) ; ( ( Group ) entity ) . getMembers ( ) . add ( memberDO ) ; } } catch ( Exception e ) { throw new WIMApplicationException ( WIMMessageKey . ENTITY_GET_FAILED , Tr . formatMessage ( tc , WIMMessageKey . ENTITY_GET_FAILED , WIMMessageHelper . generateMsgParms ( securityName , e . toString ( ) ) ) ) ; } }
Get the groups for the user and add the specified attributes to each of the groups .
24,715
public static long random ( final long randomStart ) { long randomValue = randomStart ; randomValue ^= ( randomValue << 21 ) ; randomValue ^= ( randomValue >>> 35 ) ; randomValue ^= ( randomValue << 4 ) ; return randomValue ; }
Calculate a random value based on the given start Value .
24,716
public JsPermittedChainUsage fromString ( String name ) { JsPermittedChainUsage result = null ; for ( int i = 0 ; i < _set . length && result == null ; i ++ ) { if ( name . equals ( _set [ i ] . toString ( ) ) ) result = _set [ i ] ; } return result ; }
This method converts a string into an instance of the enum . If the string is not valid for this enum then null is returned .
24,717
public OSGiInjectionScopeData getInjectionScopeData ( ComponentMetaData cmd , NamingConstants . JavaColonNamespace namespace ) { if ( cmd == null ) { return null ; } if ( namespace == NamingConstants . JavaColonNamespace . GLOBAL ) { return globalScopeData ; } if ( namespace == NamingConstants . JavaColonNamespace . COMP || namespace == NamingConstants . JavaColonNamespace . COMP_ENV ) { OSGiInjectionScopeData isd = ( OSGiInjectionScopeData ) cmd . getMetaData ( componentMetaDataSlot ) ; if ( isd == null ) { ModuleMetaData mmd = cmd . getModuleMetaData ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "trying module " + mmd ) ; } isd = ( OSGiInjectionScopeData ) cmd . getModuleMetaData ( ) . getMetaData ( moduleMetaDataSlot ) ; if ( isd == null || ! isd . isCompAllowed ( ) ) { return null ; } } return isd ; } ModuleMetaData mmd = cmd . getModuleMetaData ( ) ; if ( namespace == NamingConstants . JavaColonNamespace . MODULE ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "trying " + mmd ) ; } return ( OSGiInjectionScopeData ) mmd . getMetaData ( moduleMetaDataSlot ) ; } if ( namespace == NamingConstants . JavaColonNamespace . APP ) { ApplicationMetaData amd = mmd . getApplicationMetaData ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "trying " + amd ) ; } return ( OSGiInjectionScopeData ) amd . getMetaData ( applicationMetaDataSlot ) ; } return null ; }
Gets the injection scope data for a namespace .
24,718
private void processApplicationReferences ( EARApplicationInfo appInfo , Application app ) throws StateChangeException { Map < JNDIEnvironmentRefType , List < ? extends JNDIEnvironmentRef > > allRefs = new EnumMap < JNDIEnvironmentRefType , List < ? extends JNDIEnvironmentRef > > ( JNDIEnvironmentRefType . class ) ; boolean anyRefs = false ; for ( JNDIEnvironmentRefType refType : JNDIEnvironmentRefType . VALUES ) { List < ? extends JNDIEnvironmentRef > refs = refType . getRefs ( app ) ; allRefs . put ( refType , refs ) ; anyRefs |= ! refs . isEmpty ( ) ; } if ( anyRefs ) { ApplicationBnd appBnd ; try { appBnd = appInfo . getContainer ( ) . adapt ( ApplicationBnd . class ) ; } catch ( UnableToAdaptException e ) { throw new StateChangeException ( e ) ; } String compNSConfigName = appInfo . getName ( ) + " META-INF/application.xml" ; ComponentNameSpaceConfiguration compNSConfig = new ComponentNameSpaceConfiguration ( compNSConfigName , ( ( ExtendedApplicationInfo ) appInfo ) . getMetaData ( ) . getJ2EEName ( ) ) ; compNSConfig . setClassLoader ( appInfo . getApplicationClassLoader ( ) ) ; compNSConfig . setApplicationMetaData ( ( ( ExtendedApplicationInfo ) appInfo ) . getMetaData ( ) ) ; JNDIEnvironmentRefType . setAllRefs ( compNSConfig , allRefs ) ; if ( appBnd != null ) { Map < JNDIEnvironmentRefType , Map < String , String > > allBindings = JNDIEnvironmentRefBindingHelper . createAllBindingsMap ( ) ; Map < String , String > envEntryValues = new HashMap < String , String > ( ) ; ResourceRefConfigList resourceRefConfigList = resourceRefConfigFactory . createResourceRefConfigList ( ) ; OSGiJNDIEnvironmentRefBindingHelper . processBndAndExt ( allBindings , envEntryValues , resourceRefConfigList , appBnd , null ) ; JNDIEnvironmentRefBindingHelper . setAllBndAndExt ( compNSConfig , allBindings , envEntryValues , resourceRefConfigList ) ; } try { processInjectionMetaData ( null , compNSConfig ) ; } catch ( InjectionException e ) { throw new StateChangeException ( e ) ; } } }
Process references declared in application . xml .
24,719
boolean isTransactionRolledBack ( ) { final String methodName = "isTransactionRolledBack" ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , methodName ) ; } boolean isRolledBack = true ; Boolean rolledBack = null ; if ( _lastXidUsed != null ) { synchronized ( _transactionStates ) { rolledBack = ( Boolean ) _transactionStates . remove ( _lastXidUsed ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { StringBuffer sb = new StringBuffer ( "After removing the xid " ) ; sb . append ( _lastXidUsed ) ; sb . append ( " the hashtable of transactionStates now contains " ) ; sb . append ( _transactionStates . size ( ) ) ; sb . append ( " entries" ) ; SibTr . debug ( this , TRACE , sb . toString ( ) ) ; } } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "WARNING! No last Xid set" ) ; } } if ( rolledBack != null ) { isRolledBack = rolledBack . booleanValue ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , methodName , Boolean . valueOf ( isRolledBack ) ) ; } return isRolledBack ; }
Checks if the transaction was rolled back or not . If for some reason we could not obtain the transaction state then we return true indicating a rollback .
24,720
public static void rcvXAOpen ( CommsByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvXAOpen" , new Object [ ] { request , conversation , "" + requestNumber , "" + allocatedFromBufferPool , "" + partOfExchange } ) ; short connectionObjectId = request . getShort ( ) ; int clientTransactionId = request . getInt ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "Connection Object ID" , connectionObjectId ) ; SibTr . debug ( tc , "Transaction ID" , clientTransactionId ) ; } try { conversation . send ( poolManager . allocate ( ) , JFapChannelConstants . SEG_XAOPEN_R , requestNumber , JFapChannelConstants . PRIORITY_MEDIUM , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".rcvXAOpen" , CommsConstants . STATICCATXATRANSACTION_XAOPEN_01 ) ; SibTr . error ( tc , "COMMUNICATION_ERROR_SICO2027" , e ) ; } request . release ( allocatedFromBufferPool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvXAOpen" ) ; }
Gets the XAResource from the SICoreConnection and stores it in the object store .
24,721
private synchronized void recordElapsedTime ( ) { if ( startTime == 0 ) return ; long current = System . nanoTime ( ) ; timeWaited += Math . abs ( current - startTime ) ; startTime = current ; }
Record the elapsed time and continue timing from now .
24,722
private void waitForEventOrTimeout ( ) throws InterruptedException { long remainingWait = timeout - timeWaited ; long millisToWait = remainingWait / 1000000 ; int nanosToWait = ( int ) ( remainingWait % 1000000 ) ; wait ( millisToWait , nanosToWait ) ; }
Wait for a notification or a timeout - may wake spuriously .
24,723
public static String toHexString ( byte [ ] byteSource , int bytes ) { StringBuffer result = null ; boolean truncated = false ; if ( byteSource != null ) { if ( bytes > byteSource . length ) { bytes = byteSource . length ; } else if ( bytes < byteSource . length ) { truncated = true ; } result = new StringBuffer ( bytes * 2 ) ; for ( int i = 0 ; i < bytes ; i ++ ) { result . append ( _digits . charAt ( ( byteSource [ i ] >> 4 ) & 0xf ) ) ; result . append ( _digits . charAt ( byteSource [ i ] & 0xf ) ) ; } if ( truncated ) { result . append ( "... (" + bytes + "/" + byteSource . length + ")" ) ; } else { result . append ( "(" + bytes + ")" ) ; } } else { result = new StringBuffer ( "null" ) ; } return ( result . toString ( ) ) ; }
Converts a byte array into a printable hex string .
24,724
private String getObjectInfoFromRealObject ( ) throws IOException , ClassNotFoundException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getObjectInfoFromRealObject" ) ; final Serializable obj = objMsg . getRealObject ( ) ; final String oscDesc = ( obj == null ) ? "null" : ObjectStreamClass . lookupAny ( obj . getClass ( ) ) . toString ( ) ; final String result = String . format ( "%s: %s" , HEADER_PAYLOAD_OBJ , oscDesc ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getObjectInfoFromRealObject" , result ) ; return result ; }
Gets a description of the class for the object payload from the real object .
24,725
private String getObjectInfoFromSerializedObject ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getObjectInfoFromSerializedObject" ) ; String oscDesc ; byte [ ] data = new byte [ 0 ] ; try { data = objMsg . getSerializedObject ( ) ; oscDesc = SerializedObjectInfoHelper . getObjectInfo ( data ) ; } catch ( ObjectFailedToSerializeException e ) { oscDesc = String . format ( "unserializable class: %s" , e . getExceptionInserts ( ) [ 0 ] ) ; } final String result = String . format ( "%s: %d%n%s: %s" , HEADER_PAYLOAD_SIZE , data . length , HEADER_PAYLOAD_OBJ , oscDesc ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getObjectInfoFromSerializedObject" , result ) ; return result ; }
Gets a description of the class for the object payload from the serialized data .
24,726
public byte [ ] createUniqueId ( ) throws SIConnectionDroppedException , SIConnectionUnavailableException , SIConnectionLostException , SIResourceException , SIErrorException { checkValid ( ) ; return _delegateConnection . createUniqueId ( ) ; }
Creates a unique identifier . Checks that the connection is valid and then delegates .
24,727
public SIDestinationAddress createTemporaryDestination ( final Distribution distribution , final String destinationPrefix ) throws SIConnectionDroppedException , SIConnectionUnavailableException , SIConnectionLostException , SILimitExceededException , SINotAuthorizedException , SIInvalidDestinationPrefixException , SIResourceException , SIErrorException { checkValid ( ) ; return _delegateConnection . createTemporaryDestination ( distribution , destinationPrefix ) ; }
Creates a temporary destination . Checks that the connection is valid and then delegates .
24,728
public Serializable invokeCommand ( String key , String commandName , Serializable commandData ) throws SIConnectionDroppedException , SIConnectionUnavailableException , SINotAuthorizedException , SIResourceException , SIIncorrectCallException , SICommandInvocationFailedException { return _delegateConnection . invokeCommand ( key , commandName , commandData ) ; }
Calls invokeCommand on the delegate connection .
24,729
public void close ( ) throws SIConnectionLostException , SIResourceException , SIErrorException , SIConnectionDroppedException , SIConnectionUnavailableException { try { _delegateConnection . close ( ) ; } finally { if ( _managedConnection != null ) { _managedConnection . connectionClosed ( this ) ; } } }
Closes this connection . Delegates and then informs the current managed connection .
24,730
public void send ( final SIBusMessage msg , final SITransaction tran , final SIDestinationAddress destAddr , final DestinationType destType , final OrderingContext orderingContext , final String alternateUser ) throws SIConnectionDroppedException , SIConnectionUnavailableException , SIConnectionLostException , SILimitExceededException , SINotAuthorizedException , SITemporaryDestinationNotFoundException , SIResourceException , SIErrorException , SIIncorrectCallException , SINotPossibleInCurrentConfigurationException { checkValid ( ) ; _delegateConnection . send ( msg , mapTransaction ( tran ) , destAddr , destType , orderingContext , alternateUser ) ; }
Sends a message . Checks that the connection is valid . Maps the transaction parameter before delegating .
24,731
public void addConnectionListener ( SICoreConnectionListener listener ) throws SIConnectionDroppedException , SIConnectionUnavailableException { checkValid ( ) ; _delegateConnection . addConnectionListener ( listener ) ; }
Adds a connection listener . Checks that the connection is valid and then delegates .
24,732
public void sendToExceptionDestination ( SIDestinationAddress address , SIBusMessage message , int reason , String [ ] inserts , SITransaction tran , final String alternateUser ) throws SIConnectionDroppedException , SIConnectionUnavailableException , SIConnectionLostException , SILimitExceededException , SINotAuthorizedException , SIResourceException , SIErrorException , SIIncorrectCallException , SINotPossibleInCurrentConfigurationException { checkValid ( ) ; _delegateConnection . sendToExceptionDestination ( address , message , reason , inserts , mapTransaction ( tran ) , alternateUser ) ; }
Check the connection is valid then delegates .
24,733
public DestinationConfiguration getDestinationConfiguration ( final SIDestinationAddress destinationAddress ) throws SIConnectionDroppedException , SIConnectionUnavailableException , SIConnectionLostException , SINotAuthorizedException , SITemporaryDestinationNotFoundException , SIResourceException , SIErrorException , SIIncorrectCallException , SINotPossibleInCurrentConfigurationException { checkValid ( ) ; return _delegateConnection . getDestinationConfiguration ( destinationAddress ) ; }
Returns the configuration for the given destination . Checks that the connection is valid and then delegates .
24,734
public SIBusMessage receiveNoWait ( final SITransaction tran , final Reliability unrecoverableReliability , final SIDestinationAddress destinationAddress , final DestinationType destType , final SelectionCriteria criteria , final Reliability reliability , final String alternateUser ) throws SIConnectionDroppedException , SIConnectionUnavailableException , SIConnectionLostException , SILimitExceededException , SINotAuthorizedException , SIDestinationLockedException , SITemporaryDestinationNotFoundException , SIResourceException , SIErrorException , SIIncorrectCallException , SINotPossibleInCurrentConfigurationException { checkValid ( ) ; return _delegateConnection . receiveNoWait ( mapTransaction ( tran ) , unrecoverableReliability , destinationAddress , destType , criteria , reliability , alternateUser ) ; }
Receives a message . Checks that the connection is valid . Maps the transaction parameter before delegating .
24,735
public String getResolvedUserid ( ) throws SIConnectionDroppedException , SIConnectionUnavailableException , SIConnectionLostException , SIResourceException , SIErrorException { checkValid ( ) ; return _delegateConnection . getResolvedUserid ( ) ; }
Returns the userid associated with this connection . Checks that the connection is valid and then delegates .
24,736
public SIDestinationAddress checkMessagingRequired ( SIDestinationAddress requestDestAddr , SIDestinationAddress replyDestAddr , DestinationType destinationType , String alternateUser ) throws SIConnectionDroppedException , SIConnectionUnavailableException , SIIncorrectCallException , SITemporaryDestinationNotFoundException , SIResourceException , SINotAuthorizedException , SINotPossibleInCurrentConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "checkMessagingRequired" ) ; } SIDestinationAddress retVal = _delegateConnection . checkMessagingRequired ( requestDestAddr , replyDestAddr , destinationType , alternateUser ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "checkMessagingRequired" , retVal ) ; } return retVal ; }
Performs the following checks to see if a messaging operation can be avoided by the calling application
24,737
public BifurcatedConsumerSession createBifurcatedConsumerSession ( final long id ) throws SISessionDroppedException , SIConnectionDroppedException , SISessionUnavailableException , SIConnectionUnavailableException , SIConnectionLostException , SILimitExceededException , SINotAuthorizedException , SIResourceException , SIErrorException , SIIncorrectCallException { checkValid ( ) ; final BifurcatedConsumerSession session = _delegateConnection . createBifurcatedConsumerSession ( id ) ; return new SibRaBifurcatedConsumerSession ( this , session ) ; }
This method is used to create a BifurcatedConsumerSession object which is an additional session representing an existing consumer . Checks that the connection is valid and then delegates .
24,738
private SibRaManagedConnection getAssociatedManagedConnection ( ) throws SIResourceException { try { if ( _managedConnection == null ) { final ConnectionManager connectionManager = _connectionFactory . getConnectionManager ( ) ; if ( connectionManager instanceof LazyAssociatableConnectionManager ) { ( ( LazyAssociatableConnectionManager ) connectionManager ) . associateConnection ( this , _connectionFactory . getManagedConnectionFactory ( ) , _requestInfo ) ; } else { final ResourceException exception = new ResourceAdapterInternalException ( NLS . getFormattedMessage ( "LAZY_ENLIST_NOT_SUPPORTED_CWSIV0154" , new Object [ ] { connectionManager } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } throw exception ; } } } catch ( ResourceException exception ) { FFDCFilter . processException ( exception , "com.ibm.ws.sib.ra.impl.SibRaConnection.getAssociatedManagedConnection" , "1:1843:1.41" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } throw new SIResourceException ( NLS . getFormattedMessage ( "REASSOCIATION_FAILED_CWSIV0155" , new Object [ ] { exception } , null ) , exception ) ; } return _managedConnection ; }
Returns the managed connection associated with this connection . If the connection is not currently associated then calls the connection manager to be re - associated .
24,739
private SITransaction getContainerTransaction ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "getContainerTransaction" ) ; } final SITransaction containerTransaction ; try { final SibRaManagedConnection managedConnection = getAssociatedManagedConnection ( ) ; containerTransaction = managedConnection . getContainerTransaction ( _connectionFactory . getConnectionManager ( ) ) ; } catch ( ResourceException exception ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEventEnabled ( ) ) { SibTr . exception ( this , TRACE , exception ) ; } throw new SIResourceException ( NLS . getFormattedMessage ( "CONTAINER_TRAN_CWSIV0157" , new Object [ ] { exception } , null ) , exception ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "getContainerTransaction" , containerTransaction ) ; } return containerTransaction ; }
Returns the current container transaction if any .
24,740
void setConnectionFactory ( final SibRaConnectionFactory connectionFactory ) { if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . entry ( this , TRACE , "setConnectionFactory" , connectionFactory ) ; } _connectionFactory = connectionFactory ; if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isEntryEnabled ( ) ) { SibTr . exit ( this , TRACE , "setConnectionFactory" ) ; } }
Sets the parent connection factory . Called by the connection factory prior to returning the connection to the caller . The connection factory is needed in order to obtain the connection manager and managed connection factory in order to perform lazy enlistment and re - association .
24,741
public void setCustomProperties ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setCustomProperties" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setCustomProperties" ) ; }
Set a custom property for the bus
24,742
public void setCustomProperty ( String name , String value ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setCustomProperty" , name + " " + value ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setCustomProperty" ) ; }
Set an individual custom property for the bus
24,743
public String getCustomProperty ( String name ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getCustomProperty" , name ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getCustomProperty" , "value" ) ; return null ; }
This method returns a custom property that was configured for the bus .
24,744
public Boolean isEventNotificationPropertySet ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isEventNotificationPropertySet" , this ) ; Boolean enabled = null ; if ( customProperties . containsKey ( JsConstants . SIB_EVENT_NOTIFICATION_KEY ) ) { String value = customProperties . getProperty ( JsConstants . SIB_EVENT_NOTIFICATION_KEY ) ; if ( value != null ) { if ( value . equals ( JsConstants . SIB_EVENT_NOTIFICATION_VALUE_ENABLED ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Event Notification is enabled at the Bus" ) ; enabled = Boolean . TRUE ; } else if ( value . equals ( JsConstants . SIB_EVENT_NOTIFICATION_VALUE_DISABLED ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Event Notification is disabled at the Bus" ) ; enabled = Boolean . FALSE ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Event Notification Bus property set to: " + value ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "isEventNotificationPropertySet" , enabled ) ; return enabled ; }
Test whether Event Notification is enabled for the bus .
24,745
private void loadAuditAllowed ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "loadAuditAllowed" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "loadAuditAllowed" ) ; }
Loads the audit document for this bus
24,746
public synchronized void generatePluginConfig ( String root , String serverName , boolean utilityRequest , File writeDirectory ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "generatePluginConfig" , "server is stopping = " + serverIsStopping ) ; } try { generateInProgress = true ; if ( ! serverIsStopping ) { PluginGenerator generator = pluginGenerator ; if ( generator == null ) { generator = pluginGenerator = new PluginGenerator ( this . config , locMgr , bundleContext ) ; } generator . generateXML ( root , serverName , ( WebContainer ) webContainer , smgr , dynVhostMgr , locMgr , utilityRequest , writeDirectory ) ; } } catch ( Throwable t ) { FFDCFilter . processException ( t , getClass ( ) . getName ( ) , "generatePluginConfig" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Error generate plugin xml: " + t . getMessage ( ) ) ; } } finally { generateInProgress = false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "generatePluginConfig" , "server is stopping = " + serverIsStopping ) ; } }
Subcommand for creating the plugin - cfg . xml file at runtime using the user provided Plugin install root and Plugin server name .
24,747
public boolean isErrorPagePresent ( ExternalContext externalContext ) { IServletContext context = ( IServletContext ) externalContext . getContext ( ) ; WebAppConfig webAppConfig = context . getWebAppConfig ( ) ; return webAppConfig . isErrorPagePresent ( ) ; }
check if the web config defined the error pages
24,748
public final boolean removeDeliveryDelayable ( DeliveryDelayable deliveryDelayable ) throws SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "removeDeliveryDelayable" , "objId=" + ( deliveryDelayable == null ? "null" : String . valueOf ( deliveryDelayable . deliveryDelayableGetID ( ) ) ) + " ET=" + ( deliveryDelayable == null ? "null" : String . valueOf ( deliveryDelayable . deliveryDelayableGetDeliveryDelayTime ( ) ) ) + " addEnabled=" + addEnabled ) ; } boolean reply = false ; boolean cancelled = false ; synchronized ( lockObject ) { if ( addEnabled && deliveryDelayable != null ) { long deliveryDelay = deliveryDelayable . deliveryDelayableGetDeliveryDelayTime ( ) ; DeliveryDelayableReference delayedDeliverableRef = new DeliveryDelayableReference ( deliveryDelayable ) ; delayedDeliverableRef . setDeliveryDelayTime ( deliveryDelay ) ; reply = deliveryDelayIndex . remove ( delayedDeliverableRef ) ; if ( reply && deliveryDelayIndex . size ( ) <= 0 ) { if ( deliveryDelayAlarm != null ) { deliveryDelayAlarm . cancel ( ) ; alarmScheduled = false ; cancelled = true ; } } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "removeDeliveryDelayable" , "deliveryDelayIndexSize=" + deliveryDelayIndex . size ( ) + " reply=" + reply + " cancelled=" + cancelled ) ; return reply ; }
Remove an DeliveryDelayable reference for an item from the deliveryDelay index .
24,749
public final void start ( long deliveryDelayScanInterval , JsMessagingEngine jsme ) throws SevereMessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "start" , "interval=" + deliveryDelayScanInterval + " indexSize=" + deliveryDelayIndex . size ( ) ) ; messagingEngine = jsme ; if ( deliveryDelayScanInterval >= 0 ) { interval = deliveryDelayScanInterval ; } else { String value = messageStore . getProperty ( MessageStoreConstants . PROP_DELIVERY_DELAY_SCAN_INTERVAL , MessageStoreConstants . PROP_DELIVERY_DELAY_SCAN_INTERVAL_DEFAULT ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "start" , "Value from property=<" + value + ">" ) ; try { this . interval = Long . parseLong ( value . trim ( ) ) ; } catch ( NumberFormatException e ) { lastException = e ; lastExceptionTime = timeNow ( ) ; SibTr . debug ( this , tc , "start" , "Unable to parse property: " + e ) ; this . interval = 1000 ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "start" , "deliveryDelayScanInterval=" + this . interval ) ; synchronized ( lockObject ) { if ( interval < 1 ) { runEnabled = false ; addEnabled = false ; } else { if ( deliveryDelayAlarm == null ) { scanForInvalidDeliveryDelay ( ) ; runEnabled = true ; addEnabled = true ; deliveryDelayManagerStartTime = timeNow ( ) ; if ( deliveryDelayIndex . size ( ) > 0 ) { scheduleAlarm ( interval ) ; } } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "DeliveryDelayManager already started" ) ; SevereMessageStoreException e = new SevereMessageStoreException ( "DELIVERYDELAYMANAGER_THREAD_ALREADY_RUNNING_SIMS2012" ) ; lastException = e ; lastExceptionTime = timeNow ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "start" ) ; throw e ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "start" , "runEnabled=" + runEnabled + " addEnabled=" + addEnabled + " interval=" + interval ) ; }
Start the DeliveryDelayManager daemon .
24,750
private void scanForInvalidDeliveryDelay ( ) throws SevereMessageStoreException { final String methodName = "scanForInvalidDeliveryDelay" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , methodName ) ; String str = messageStore . getProperty ( MessageStoreConstants . PROP_MAXIMUM_ALLOWED_DELIVERY_DELAY_INTERVAL , MessageStoreConstants . PROP_MAXIMUM_ALLOWED_DELIVERY_DELAY_INTERVAL_DEFAULT ) ; if ( str . equals ( MessageStoreConstants . PROP_MAXIMUM_ALLOWED_DELIVERY_DELAY_INTERVAL_DEFAULT ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , methodName , "No scan" ) ; return ; } try { final long maximumAllowedDeliveryDelayInterval = Long . parseLong ( str ) ; maximumTime = System . currentTimeMillis ( ) + maximumAllowedDeliveryDelayInterval ; } catch ( NumberFormatException exception ) { lastException = exception ; lastExceptionTime = timeNow ( ) ; SibTr . debug ( this , tc , methodName , "Unable to parse property: " + exception ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , methodName , "No scan, exception=" + exception ) ; return ; } MessageStoreConstants . MaximumAllowedDeliveryDelayAction action ; try { String actionStr = messageStore . getProperty ( MessageStoreConstants . PROP_MAXIMUM_ALLOWED_DELIVERY_DELAY_ACTION , MessageStoreConstants . PROP_MAXIMUM_ALLOWED_DELIVERY_DELAY_ACTION_DEFAULT ) ; action = MessageStoreConstants . MaximumAllowedDeliveryDelayAction . valueOf ( actionStr ) ; } catch ( IllegalArgumentException illegalArgumentException ) { lastException = illegalArgumentException ; lastExceptionTime = timeNow ( ) ; SibTr . debug ( this , tc , methodName , "Unable to parse property: " + illegalArgumentException ) ; action = MessageStoreConstants . MaximumAllowedDeliveryDelayAction . warn ; } deliveryDelayIndex . resetIterator ( ) ; DeliveryDelayableReference deliveryDelayableRef = deliveryDelayIndex . next ( ) ; try { while ( deliveryDelayableRef != null && deliveryDelayableRef . getDeliveryDelayTime ( ) > maximumTime ) { DeliveryDelayable deliveryDelayable = ( DeliveryDelayable ) deliveryDelayableRef . get ( ) ; SibTr . debug ( this , tc , methodName , "deliveryDelayable=" + deliveryDelayable + " deliveryDelayable.deliveryDelayableIsInStore()=" + deliveryDelayable . deliveryDelayableIsInStore ( ) ) ; if ( deliveryDelayable != null && deliveryDelayable . deliveryDelayableIsInStore ( ) ) { boolean unlocked = deliveryDelayable . handleInvalidDeliveryDelayable ( action ) ; if ( unlocked ) remove ( deliveryDelayableRef , true ) ; } deliveryDelayableRef = deliveryDelayIndex . next ( ) ; } } catch ( MessageStoreException | SIException exception ) { SevereMessageStoreException severeMessageStoreException = new SevereMessageStoreException ( exception ) ; lastException = exception ; lastExceptionTime = timeNow ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , methodName , severeMessageStoreException ) ; throw severeMessageStoreException ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , methodName ) ; }
Scan the delivery delay intervals loaded at startup to determine if any may have been migrated incorrectly .
24,751
public final void stop ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "stop" ) ; synchronized ( lockObject ) { addEnabled = false ; if ( runEnabled ) { runEnabled = false ; deliveryDelayManagerStopTime = timeNow ( ) ; } if ( deliveryDelayAlarm != null ) { deliveryDelayAlarm . cancel ( ) ; deliveryDelayAlarm = null ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "stop" ) ; }
Stop the DeliveryDelayManager daemon .
24,752
private final boolean remove ( DeliveryDelayableReference deliveryDelayableReference , boolean unlocked ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "remove" , " deliveryDelayableReference=" + deliveryDelayableReference + " unlocked=" + unlocked + " deliveryDelayIndex=" + deliveryDelayIndex . size ( ) ) ; boolean reply = false ; synchronized ( lockObject ) { reply = deliveryDelayIndex . remove ( ) ; } if ( reply ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Removed (" + ( unlocked ? "unlocked" : "gone" ) + ")" + " DDT=" + deliveryDelayableReference . getDeliveryDelayTime ( ) + " objId=" + deliveryDelayableReference . getID ( ) + " DeliveryDelayIndexSize=" + deliveryDelayIndex . size ( ) ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Did not remove from index: " + " DDT=" + deliveryDelayableReference . getDeliveryDelayTime ( ) + " objId=" + deliveryDelayableReference . getID ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "remove" , "deliveryDelayIndex=" + deliveryDelayIndex . size ( ) + " reply=" + reply ) ; return reply ; }
Remove the DeliveryDelayable reference from the DeliveryDelay index . This will remove the current entry pointed - to by the iterator .
24,753
@ SuppressWarnings ( "unchecked" ) protected void addArrayValue ( AnnotationValueImpl annotationValue ) { ( ( List < AnnotationValueImpl > ) getArrayValue ( ) ) . add ( annotationValue ) ; this . stringValue = null ; }
case of visitor calls to process array element values .
24,754
public static UserRegistry getUserRegistry ( String realmName ) throws WSSecurityException { try { WSSecurityService ss = wsSecurityServiceRef . getService ( ) ; if ( ss == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No WSSecurityService, returning null" ) ; } } else { return ss . getUserRegistry ( realmName ) ; } } catch ( WSSecurityException e ) { String msg = "getUserRegistry for realm " + realmName + " failed due to an internal error: " + e . getMessage ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , msg , e ) ; } throw new WSSecurityException ( msg , e ) ; } return null ; }
Gets the UserRegistry object for the given realm . If the realm name is null returns the active registry . If the realm is not valid or security is not enabled or no registry is configured returns null .
24,755
public static boolean isRealmInboundTrusted ( String inboundRealm , String localRealm ) { WSSecurityService ss = wsSecurityServiceRef . getService ( ) ; if ( ss == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "No WSSecurityService, returning true" ) ; } return true ; } else { return ss . isRealmInboundTrusted ( inboundRealm , localRealm ) ; } }
Determine if the inbound realm is one of the trusted realms of the specified local realm . If the local realm is null the realm of the current active user registry will be used .
24,756
final public SelectionKey getKey ( SocketChannel channel ) { if ( null == channel ) { return null ; } return channel . keyFor ( this . selector ) ; }
Access the possible SelectionKey on this selector for the provided channel .
24,757
protected Queue < Object > getWorkQueue ( ) { synchronized ( this . queueLock ) { Queue < Object > tmp = this . workQueue1 ; this . workQueue1 = this . workQueue2 ; this . workQueue2 = tmp ; return tmp ; } }
Access the current work queue of pending updates for the selector . This will cause further updates to go onto another queue until this method is called again .
24,758
protected void resetTimeout ( long newTimeoutTime ) { if ( newTimeoutTime < this . nextTimeoutTime ) { this . nextTimeoutTime = newTimeoutTime ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "resetTimeout waking up selector" ) ; } wakeup ( ) ; } }
Set the next timeout marker to the provided value if appropriate .
24,759
protected < T > T instantiateClass ( Class < T > clazz ) throws Throwable { ManagedObject < T > mo = null ; if ( releasableFactory != null ) { mo = releasableFactory . createValidationReleasable ( clazz ) ; } if ( mo != null ) { if ( releasables == null ) { releasables = new LinkedList < ValidationReleasable < ? > > ( ) ; } return mo . getObject ( ) ; } else { return super . instantiateClass ( clazz ) ; } }
Override the base implementation so that when a class is instantiated it is done so as a CDI managed bean .
24,760
public ConstraintValidatorFactory getConstraintValidatorFactoryOverride ( Configuration < ? > config ) { ValidationReleasable < ConstraintValidatorFactory > releasable = null ; String cvfClassName = config . getBootstrapConfiguration ( ) . getConstraintValidatorFactoryClassName ( ) ; if ( cvfClassName == null && releasableFactory != null ) { releasable = releasableFactory . createConstraintValidatorFactory ( ) ; } if ( releasable != null ) { if ( releasables == null ) { releasables = new LinkedList < ValidationReleasable < ? > > ( ) ; } releasables . add ( releasable ) ; return releasable . getInstance ( ) ; } return null ; }
Get the default WebSphere ConstraintValidatorFactory as a managed object .
24,761
static ContentMatcher createMatcher ( OrdinalPosition lastOrdinalPosition , Conjunction selector , ContentMatcher oldMatcher ) { if ( tc . isEntryEnabled ( ) ) tc . entry ( cclass , "createMatcher" , "lastOrdinalPosition: " + lastOrdinalPosition + ",selector: " + selector + ", oldmatcher: " + oldMatcher ) ; if ( oldMatcher instanceof DifficultMatcher ) { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "Reusing old DifficultMatcher with position: " + oldMatcher . ordinalPosition + " for position " + lastOrdinalPosition ) ; if ( tc . isEntryEnabled ( ) ) tc . exit ( cclass , "createMatcher" ) ; return oldMatcher ; } if ( oldMatcher != null && oldMatcher . ordinalPosition . compareTo ( lastOrdinalPosition ) < 0 ) throw new IllegalStateException ( ) ; if ( selector != null ) for ( int i = 0 ; i < selector . getSimpleTests ( ) . length ; i ++ ) { OrdinalPosition newPos = ( OrdinalPosition ) selector . getSimpleTests ( ) [ i ] . getIdentifier ( ) . getOrdinalPosition ( ) ; if ( oldMatcher != null && newPos . compareTo ( oldMatcher . ordinalPosition ) >= 0 ) { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "Reusing " + oldMatcher . getClass ( ) . getName ( ) + " for position: " + lastOrdinalPosition + "; next test is at: " + newPos ) ; if ( tc . isEntryEnabled ( ) ) tc . exit ( cclass , "createMatcher" ) ; return oldMatcher ; } if ( newPos . compareTo ( lastOrdinalPosition ) > 0 ) { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "Creating new matcher at position " + newPos ) ; if ( tc . isEntryEnabled ( ) ) tc . exit ( cclass , "createMatcher" ) ; return createMatcher ( selector . getSimpleTests ( ) [ i ] , oldMatcher ) ; } } ContentMatcher ans = new DifficultMatcher ( lastOrdinalPosition ) ; if ( tc . isDebugEnabled ( ) ) { if ( oldMatcher != null ) tc . debug ( cclass , "createMatcher" , "New DifficultMatcher at position " + lastOrdinalPosition + " with successor " + oldMatcher . getClass ( ) . getName ( ) + " at position " + oldMatcher . ordinalPosition ) ; else tc . debug ( cclass , "createMatcher" , "New DifficultMatcher at position " + lastOrdinalPosition + " with null successor." ) ; } ans . vacantChild = oldMatcher ; if ( tc . isEntryEnabled ( ) ) tc . exit ( cclass , "createMatcher" ) ; return ans ; }
Create a new ContentMatcher given the ordinal position of the parent and the child Matcher that currently occupies the place in which the new ContentMatcher will be placed . Sometimes no new ContentMatcher is created because the old child Matcher is either usable as is or needs to have the new ContentMatcher created below it . In that case the old Matcher is returned .
24,762
private static ContentMatcher createMatcher ( SimpleTest test , ContentMatcher oldMatcher ) { if ( tc . isEntryEnabled ( ) ) tc . entry ( cclass , "createMatcher" , "test: " + test + ", oldmatcher: " + oldMatcher ) ; Identifier id = test . getIdentifier ( ) ; boolean isExtended = ( test instanceof ExtendedSimpleTestImpl ) ; ContentMatcher ans ; switch ( id . getType ( ) ) { case Selector . BOOLEAN : if ( ! isExtended ) { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New BooleanMatcher for id " + id . getName ( ) ) ; ans = new BooleanMatcher ( id ) ; } else { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New SetValBooleanMatcher for id " + id . getName ( ) ) ; ans = new SetValBooleanMatcher ( id ) ; } break ; case Selector . UNKNOWN : case Selector . OBJECT : if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New EqualityMatcher for id " + id . getName ( ) ) ; ans = new EqualityMatcher ( id ) ; break ; case Selector . STRING : case Selector . TOPIC : if ( ! isExtended ) { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New StringMatcher for id " + id . getName ( ) ) ; ans = new StringMatcher ( id ) ; } else { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New SetValStringMatcher for id " + id . getName ( ) ) ; ans = new SetValStringMatcher ( id ) ; } break ; case Selector . CHILD : if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New ExtensionMatcher for id " + id . getName ( ) ) ; ans = new SetValChildAccessMatcher ( id ) ; break ; default : if ( ! isExtended ) { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New NumericMatcher for id " + id . getName ( ) ) ; ans = new NumericMatcher ( id ) ; } else { if ( tc . isDebugEnabled ( ) ) tc . debug ( cclass , "createMatcher" , "New SetValNumericMatcher for id " + id . getName ( ) ) ; ans = new SetValNumericMatcher ( id ) ; } } ans . vacantChild = oldMatcher ; if ( tc . isEntryEnabled ( ) ) tc . exit ( cclass , "createMatcher" ) ; return ans ; }
Subroutine to determine the kind of Matcher to create and create it .
24,763
private void inject ( Object obj , final Object instance , HashMap < Class < ? > , InjectionTarget [ ] > cookies ) throws InjectionException { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "inject" , "obj + obj + "]" ) ; if ( cookies . size ( ) == 0 ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "inject" , "no injection cookies found" ) ; return ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "inject" , "injection cookies found" ) ; if ( cookies . containsKey ( obj ) ) { if ( instance != null ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "inject" , "about to inject via managed object + obj + "]" ) ; final ManagedObject < ? > mo ; try { mo = getManagedObject ( instance ) ; mo . inject ( cookies . get ( obj ) , null ) ; } catch ( Exception e ) { throw new InjectionException ( e . getCause ( ) ) ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "inject" , "injected + obj + "]" ) ; } else { for ( InjectionTarget cookie : cookies . get ( obj ) ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "inject" , "about to inject resource + cookie + "]" ) ; injectionEngine . inject ( obj , cookie , null ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "inject" , "injected resource + cookie + "]" ) ; } } } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "inject" , "cookies does not contains the key + obj + "]" ) ; } }
instance is considered as the first injection target but may be null in which case injection is done on obj .
24,764
public void setRoleMap ( String roleName , List < String > mList , boolean omission ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Setting rolemap with omission" ) ; setMethodsAttribute ( mList , omission , ROLE , roleName ) ; if ( omission ) { unchkResourceForOmissionList = updateList ( unchkResourceForOmissionList , mList ) ; } return ; }
if omission is true put the item to omission list .
24,765
public Map < String , String > getRoleMap ( ) { if ( mapAllMethods != null ) { return getRoleMapFromAllMap ( ) ; } Map < String , List < String > > outputRTMNormal = null ; Map < String , List < String > > outputRTMOmission = null ; if ( mapMethod != null ) { outputRTMNormal = getRoleToMethodMap ( getMethod ( mapMethod , ROLE , true ) ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "outputRTMNormal: " + outputRTMNormal ) ; } if ( mapMethodOmission != null ) { Map < String , MethodConstraint > omissionRole = getMethod ( mapMethodOmission , ROLE_NO_CHECK , true ) ; Map < String , MethodConstraint > validRole = getMethod ( mapMethodOmission , EXCLUDED_OR_UNCHECKED_NO_ROLE , true ) ; Map < String , MethodConstraint > uncheckedOrExcluded = getMethod ( mapMethodOmission , EXCLUDED_OR_UNCHECKED , true ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "omissionRole: " + omissionRole + " validRole : " + validRole + " uncheckedOrExcluded : " + uncheckedOrExcluded ) ; if ( omissionRole != null && ( ( uncheckedOrExcluded != null && validRole != null ) || uncheckedOrExcluded == null ) ) { outputRTMOmission = getRoleToMethodMap ( omissionRole ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "outputRTMOmission: " + outputRTMOmission ) ; } } Map < String , String > output = mergeRTM ( outputRTMNormal , outputRTMOmission ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getRoleMap: output: " + output ) ; return output ; }
In here null is used to represent all methods .
24,766
private String convertMethod ( List < String > methodList , boolean negative ) { boolean first = true ; StringBuffer methodSB = new StringBuffer ( ) ; for ( String method : methodList ) { if ( first ) { first = false ; if ( negative ) { methodSB . append ( "!" ) ; } } else { methodSB . append ( "," ) ; } methodSB . append ( method ) ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "convertMethod : " + methodSB . toString ( ) ) ; return methodSB . toString ( ) ; }
convert array of method to string
24,767
public Map < String , MethodConstraint > getRoleMap ( int table ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Getting role methods map" ) ; return getMethodSet ( table , ROLE_NO_CHECK ) ; }
returns entries which has a role
24,768
public Map < String , MethodConstraint > getUserDataMap ( int table ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Getting user data map of which attribute is either confidential or integral" ) ; return getMethodSet ( table , UD_CONFIDENTIAL_OR_INTEGRAL_NO_EX_CHECK ) ; }
to get entries with user data constraint is set as NONE use getUserDataMapNone method
24,769
public RepositoryResourceImpl createResourceFromAsset ( Asset ass , RepositoryConnection connection ) throws RepositoryBackendException { RepositoryResourceImpl result ; if ( null == ass . getWlpInformation ( ) || ass . getType ( ) == null ) { result = new RepositoryResourceImpl ( connection , ass ) { } ; } else { result = createResource ( ass . getType ( ) , connection , ass ) ; } result . parseAttachmentsInAsset ( ) ; return result ; }
Creates a resources from the supplied asset
24,770
private void updateTime ( long tolerance ) { long now = System . currentTimeMillis ( ) ; if ( now == this . lastTimeCheck ) { return ; } if ( 0L != tolerance ) { long range = ( - 1 == tolerance ) ? DEFAULT_TOLERANCE : tolerance ; if ( ( now - this . lastTimeCheck ) <= range ) { return ; } } this . myDate . setTime ( now ) ; this . myBuffer . setLength ( 0 ) ; this . myBuffer = this . myFormat . format ( this . myDate , this . myBuffer , new FieldPosition ( 0 ) ) ; this . sTime = null ; this . lastTimeCheck = now ; }
Utility method to determine whether to use the cached time value or update to a newly formatted timestamp .
24,771
public static String getFormattedMessageFromLocalizedMessage ( String traceString , Object [ ] newParms , boolean b ) { String retVal = "" ; try { retVal = MessageFormat . format ( traceString , newParms ) ; if ( null == retVal && b ) { retVal = traceString ; } } catch ( IllegalArgumentException e ) { retVal = traceString ; } return retVal ; }
Retrieve a string from the bundle and format it using the parameters
24,772
public String getFormattedMessage ( String messageKey , Object [ ] param , String defaultKey ) { String key = getString ( messageKey ) ; String retVal = MessageFormat . format ( key , param ) ; return retVal ; }
Retrieve a message and format it with the parameters
24,773
public String getString ( String messageKey ) { String retVal = messageKey ; ResourceBundle rb = getResourceBundle ( ) ; if ( null != rb ) { try { String tmpRetVal = rb . getString ( messageKey ) ; if ( null != tmpRetVal ) { retVal = tmpRetVal ; } } catch ( MissingResourceException e ) { } } return retVal ; }
Retrieve a message key from the resource bundle
24,774
private ResourceBundle getResourceBundle ( ) { ResourceBundle rb = null ; if ( null != ivBundleName && ! "" . equals ( ivBundleName . trim ( ) ) ) { ClassLoader classLoader = null ; try { classLoader = AccessController . doPrivileged ( new PrivilegedExceptionAction < ClassLoader > ( ) { public ClassLoader run ( ) throws Exception { return Thread . currentThread ( ) . getContextClassLoader ( ) ; } } ) ; } catch ( PrivilegedActionException e ) { throw new java . lang . RuntimeException ( e . getMessage ( ) ) ; } if ( null != classLoader ) { try { rb = ResourceBundle . getBundle ( ivBundleName , ivLocale , classLoader ) ; } catch ( MissingResourceException e ) { } } if ( null == rb ) { rb = locateBundleFromCallee ( ) ; } if ( null == rb ) { try { rb = ResourceBundle . getBundle ( ivBundleName , ivLocale ) ; } catch ( MissingResourceException e2 ) { } } } return rb ; }
Private message to locate resource bundle
24,775
private ResourceBundle locateBundleFromCallee ( ) { ResourceBundle rb = null ; if ( finder == null ) { finder = StackFinder . getInstance ( ) ; } final Class < ? > aClass = finder . getCaller ( ) ; if ( aClass != null ) { ClassLoader classLoader = null ; try { classLoader = AccessController . doPrivileged ( new PrivilegedExceptionAction < ClassLoader > ( ) { public ClassLoader run ( ) throws Exception { return aClass . getClassLoader ( ) ; } } ) ; } catch ( PrivilegedActionException e ) { throw new java . lang . RuntimeException ( e . getMessage ( ) ) ; } try { rb = ResourceBundle . getBundle ( ivBundleName , ivLocale , classLoader ) ; } catch ( RuntimeException re ) { } } return rb ; }
Call the stack finder to get the callee of the logging api then use the classloader from class to retrieve resource bundle
24,776
private boolean synchronizedRequestPermissionToExecute ( ) { boolean result = false ; synchronized ( this ) { switch ( state . get ( ) ) { case CLOSED : result = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Allowing execution in closed state" ) ; } break ; case HALF_OPEN : if ( halfOpenRunningExecutions < policy . getSuccessThreshold ( ) ) { halfOpenRunningExecutions ++ ; halfOpenLastExecutionStarted = System . nanoTime ( ) ; result = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Allowing execution in half-open state. Now running ({0}/{1})" , halfOpenRunningExecutions , policy . getSuccessThreshold ( ) ) ; } } else { if ( System . nanoTime ( ) - halfOpenLastExecutionStarted > policyDelayNanos ) { halfOpenLastExecutionStarted = System . nanoTime ( ) ; result = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Allowing execution in half-open state because enough time has passed without a trial executions completing" ) ; } } else { result = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Denying execution in half-open state, trial execution limit reached" ) ; } } } break ; case OPEN : if ( System . nanoTime ( ) - openStateStartTime > policyDelayNanos ) { stateHalfOpen ( ) ; halfOpenRunningExecutions ++ ; halfOpenLastExecutionStarted = System . nanoTime ( ) ; result = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Allowing execution because we just changed to half-open state" ) ; } } else { result = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Denying execution in open state" ) ; } } break ; } } return result ; }
Implements the logic for requestPermissionToExecute for the cases where synchronization is required
24,777
private void synchronizedRecordResult ( CircuitBreakerResult result ) { synchronized ( this ) { switch ( state . get ( ) ) { case CLOSED : rollingWindow . record ( result ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Recording result {0} in closed state: {1}" , result , rollingWindow ) ; } if ( rollingWindow . isOverThreshold ( ) ) { stateOpen ( ) ; } break ; case HALF_OPEN : if ( result == CircuitBreakerResult . FAILURE ) { stateOpen ( ) ; } else { halfOpenRunningExecutions -- ; halfOpenSuccessfulExecutions ++ ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Recording result {0} in half-open state. Running executions: {1}, Current results: ({2}/{3})" , result , halfOpenRunningExecutions , halfOpenSuccessfulExecutions , policy . getSuccessThreshold ( ) ) ; } if ( halfOpenSuccessfulExecutions >= policy . getSuccessThreshold ( ) ) { stateClosed ( ) ; } } break ; case OPEN : if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Recording result {0} in open state" , result ) ; } break ; } } }
Implements the logic for recordResult for the cases where synchronization is required
24,778
private void stateClosed ( ) { rollingWindow . clear ( ) ; state . set ( State . CLOSED ) ; metricRecorder . reportCircuitClosed ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Transitioned to Closed state" ) ; } }
Transition to closed state
24,779
private void stateHalfOpen ( ) { halfOpenRunningExecutions = 0 ; halfOpenSuccessfulExecutions = 0 ; state . set ( State . HALF_OPEN ) ; metricRecorder . reportCircuitHalfOpen ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Transitioned to Half Open state" ) ; } }
Transition to half open state
24,780
private void stateOpen ( ) { openStateStartTime = System . nanoTime ( ) ; state . set ( State . OPEN ) ; metricRecorder . reportCircuitOpen ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Transitioned to Open state" ) ; } }
Transition to open state
24,781
public static com . ibm . websphere . cache . Cache getCache ( ) { if ( isServletCachingEnabled ( ) ) return ( com . ibm . websphere . cache . Cache ) ServerCache . cache ; else return null ; }
This obtains a reference to the dynamic cache .
24,782
public static DistributedMap getDistributedMap ( ) { final String methodName = "getDistributedMap()" ; if ( tc . isEntryEnabled ( ) ) { Tr . entry ( tc , methodName ) ; } DistributedMap distributedMap = null ; Context context = null ; if ( isObjectCachingEnabled ( ) ) { try { context = new InitialContext ( ) ; distributedMap = ( DistributedObjectCache ) context . lookup ( DCacheBase . DEFAULT_BASE_JNDI_NAME ) ; } catch ( NamingException e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.websphere.cache.DynamicCacheAccessor.getDistributedMap" , "99" , com . ibm . websphere . cache . DynamicCacheAccessor . class ) ; } finally { try { if ( context != null ) { context . close ( ) ; } } catch ( NamingException e ) { com . ibm . ws . ffdc . FFDCFilter . processException ( e , "com.ibm.websphere.cache.DynamicCacheAccessor.getDistributedMap" , "110" , com . ibm . websphere . cache . DynamicCacheAccessor . class ) ; } } } else { Tr . error ( tc , "DYNA1060W" , new Object [ ] { DCacheBase . DEFAULT_BASE_JNDI_NAME } ) ; } if ( tc . isEntryEnabled ( ) ) { Tr . exit ( tc , methodName , distributedMap ) ; } return distributedMap ; }
This method will return a DistributedMap reference to the dynamic cache .
24,783
public Object eval ( Selector sel , MatchSpaceKey msg , EvalCache cache , Object contextValue , boolean permissive ) throws BadMessageFormatMatchingException { if ( sel . getType ( ) == Selector . INVALID ) throw new IllegalArgumentException ( ) ; Object ans ; if ( sel . getUniqueId ( ) != 0 && ! sel . isExtended ( ) ) { ans = cache . getExprValue ( sel . getUniqueId ( ) ) ; if ( ans != null ) return ans ; } ans = evalInternal ( sel , msg , cache , contextValue , permissive ) ; if ( sel . getUniqueId ( ) != 0 ) cache . saveExprValue ( sel . getUniqueId ( ) , ans ) ; return ans ; }
Evaluates a selector tree
24,784
public static Number castToNumber ( Object val ) { if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( cclass , "castToNumber" , val ) ; if ( ! ( val instanceof String ) ) { if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "castToNumber" , null ) ; return null ; } String stringVal = ( String ) val ; if ( stringVal . length ( ) == 0 ) { if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "castToNumber" , null ) ; return null ; } try { switch ( stringVal . charAt ( stringVal . length ( ) - 1 ) ) { case 'l' : case 'L' : stringVal = stringVal . substring ( 0 , stringVal . length ( ) - 1 ) ; Long theLong = new Long ( stringVal ) ; if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "castToNumber" , theLong ) ; return theLong ; case 'f' : case 'F' : Float theFloat = new Float ( stringVal ) ; if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "castToNumber" , theFloat ) ; return theFloat ; case 'd' : case 'D' : Double theDouble = new Double ( stringVal ) ; if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "castToNumber" , theDouble ) ; return theDouble ; default : try { theLong = new Long ( stringVal ) ; if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "castToNumber" , theLong ) ; return theLong ; } catch ( NumberFormatException e ) { theDouble = new Double ( stringVal ) ; if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "castToNumber" , theDouble ) ; return theDouble ; } } } catch ( NumberFormatException e ) { if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "castToNumber" , null ) ; return null ; } }
be so cast .
24,785
private static Boolean castToBoolean ( Object val ) { if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( cclass , "castToBoolean" , val ) ; Boolean theReturn = null ; if ( val instanceof String ) { String stringVal = ( String ) val ; if ( stringVal . equalsIgnoreCase ( "true" ) ) theReturn = Boolean . TRUE ; else if ( stringVal . equalsIgnoreCase ( "false" ) ) theReturn = Boolean . FALSE ; } if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "castToBoolean" , theReturn ) ; return theReturn ; }
Cast an Object which is not null and not an instance of BooleanValue to BooleanValue if possible under the permissive rules BooleanValue . NULL otherwise . In fact only a String can be so cast .
24,786
protected String getStringFromNode ( Object inNode ) { if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( cclass , "getStringFromNode" , inNode ) ; String strValue = null ; if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "getStringFromNode" , strValue ) ; return strValue ; }
Get the String value of a node .
24,787
public Object getDocumentRoot ( MatchSpaceKey msg ) throws BadMessageFormatMatchingException { if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( cclass , "getDocumentRoot" , msg ) ; Object docRoot = null ; if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "getDocumentRoot" , docRoot ) ; return docRoot ; }
Get a DOM document root from a message .
24,788
protected Boolean compareList ( ArrayList firstList , Object val1 , boolean lessThan , boolean permissive , boolean overallTrue ) { if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( cclass , "compareList" , new Object [ ] { firstList , val1 , new Boolean ( lessThan ) , new Boolean ( permissive ) , new Boolean ( overallTrue ) } ) ; Boolean finalReturn = null ; if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "compareList" , finalReturn ) ; return finalReturn ; }
An implementation of this method is provided in the derived XPath class . In the parent class it merely returns null .
24,789
private static Object promoteAndEvaluate ( int op , Object val0 , Object val1 , boolean permissive ) { if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . entry ( cclass , "promoteAndEvaluate" , new Object [ ] { new Integer ( op ) , val0 , val1 , new Boolean ( permissive ) } ) ; Object theReturn = null ; if ( val0 instanceof ArrayList ) theReturn = promoteAndEvaluateList ( op , val0 , val1 , permissive ) ; else theReturn = promoteAndEvaluateScalar ( op , val0 , val1 , permissive ) ; if ( tc . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) tc . exit ( cclass , "promoteAndEvaluate" , theReturn ) ; return theReturn ; }
Evaluate a binary numeric operator with numeric result
24,790
public static int ttIndex ( Boolean bVal ) { int idx = 2 ; if ( bVal != null ) { if ( bVal . booleanValue ( ) ) { idx = 0 ; } else if ( ! bVal . booleanValue ( ) ) { idx = 1 ; } } return idx ; }
Get Truth Table index
24,791
public static Boolean and ( Boolean a , Boolean b ) { return andTable [ ttIndex ( a ) ] [ ttIndex ( b ) ] ; }
Perform logical and between BooleanValue instances
24,792
public static Boolean or ( Boolean a , Boolean b ) { return orTable [ ttIndex ( a ) ] [ ttIndex ( b ) ] ; }
Perform logical or between BooleanValue instances
24,793
public static Boolean not ( Boolean bVal ) { if ( bVal == null ) return null ; else if ( bVal . equals ( Boolean . TRUE ) ) return Boolean . FALSE ; else if ( bVal . equals ( Boolean . FALSE ) ) return Boolean . TRUE ; else return null ; }
Perform logical not on a Boolean instance
24,794
public static int compare ( Number a , Number b ) { int aType = getType ( a ) ; int bType = getType ( b ) ; int compType = ( aType >= bType ) ? aType : bType ; switch ( compType ) { case INT : int li = a . intValue ( ) ; int ri = b . intValue ( ) ; return ( li < ri ) ? - 1 : ( li == ri ) ? 0 : 1 ; case LONG : long ll = a . longValue ( ) ; long rl = b . longValue ( ) ; return ( ll < rl ) ? - 1 : ( ll == rl ) ? 0 : 1 ; case FLOAT : float lf = a . floatValue ( ) ; float rf = b . floatValue ( ) ; return ( lf < rf ) ? - 1 : ( lf == rf ) ? 0 : 1 ; case DOUBLE : double ld = a . doubleValue ( ) ; double rd = b . doubleValue ( ) ; return ( ld < rd ) ? - 1 : ( ld == rd ) ? 0 : 1 ; default : throw new IllegalStateException ( ) ; } }
Implement Number compare
24,795
public static int getType ( Number val ) { if ( val instanceof Integer ) { return INT ; } else if ( val instanceof Long ) { return LONG ; } else if ( val instanceof Short ) { return SHORT ; } else if ( val instanceof Byte ) { return BYTE ; } else if ( val instanceof Double ) { return DOUBLE ; } else if ( val instanceof Float ) { return FLOAT ; } else throw new IllegalArgumentException ( ) ; }
Make a NumericValue from a standard wrapper subclass of Number
24,796
private static Number neg ( Number n ) { switch ( getType ( n ) ) { case INT : return new Integer ( - n . intValue ( ) ) ; case LONG : return new Long ( - n . longValue ( ) ) ; case FLOAT : return new Float ( - n . floatValue ( ) ) ; case DOUBLE : return new Double ( - n . doubleValue ( ) ) ; default : throw new IllegalStateException ( ) ; } }
Negate the value
24,797
private static Number times ( Number a , Number b ) { int aType = getType ( a ) ; int bType = getType ( b ) ; int compType = ( aType >= bType ) ? aType : bType ; switch ( compType ) { case INT : return new Integer ( a . intValue ( ) * b . intValue ( ) ) ; case LONG : return new Long ( a . longValue ( ) * b . longValue ( ) ) ; case FLOAT : return new Float ( a . floatValue ( ) * b . floatValue ( ) ) ; case DOUBLE : return new Double ( a . doubleValue ( ) * b . doubleValue ( ) ) ; default : throw new IllegalStateException ( ) ; } }
Multiply two values
24,798
protected static String getResourceNameFromDescription ( String desc ) { Type type = Type . getType ( desc ) ; String className = type . getClassName ( ) ; String resourceName = className . replace ( "." , "/" ) ; return resourceName ; }
That call should be inlined .
24,799
protected boolean i_recordScannedClassName ( String i_className ) { boolean didPlaceClass = annotationTargets . i_placeClass ( i_getClassSourceName ( ) , i_className ) ; if ( ! didPlaceClass ) { return false ; } boolean didAddClass = annotationTargets . i_addScannedClassName ( i_className , getScanPolicy ( ) ) ; return didAddClass ; }
Main record methods ...