idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
37,700
public void setDestination ( DestinationHandler originalDestination ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setDestination" , originalDestination ) ; _originalDestination = originalDestination ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setDestination" ) ; }
Sets the destination that could not be delivered to .
37,701
public void setDestination ( SIDestinationAddress destinationAddr ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setDestination" , destinationAddr ) ; if ( destinationAddr != null ) { try { _originalDestination = _messageProcessor . getDestinationManager ( ) . getDestination ( ( JsDestinationAddress ) destinationAddr , true ) ; } catch ( SIException e ) { SibTr . warning ( tc , "EXCEPTION_DESTINATION_WARNING_CWSIP0291" , new Object [ ] { destinationAddr . getDestinationName ( ) , _messageProcessor . getMessagingEngineName ( ) , e } ) ; _originalDestination = null ; } } else _originalDestination = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setDestination" , _originalDestination ) ; }
Sets the destination that could not be delivered to . Looks up the destination given its name .
37,702
public int checkCanExceptionMessage ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkCanExceptionMessage" ) ; int rc = DestinationHandler . OUTPUT_HANDLER_NOT_FOUND ; String newExceptionDestination = null ; boolean usingDefault = false ; if ( _originalDestination != null ) { newExceptionDestination = _originalDestination . getExceptionDestination ( ) ; if ( newExceptionDestination == null || newExceptionDestination . equals ( "" ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkCanExceptionMessage" , rc ) ; return rc ; } if ( newExceptionDestination . equals ( JsConstants . DEFAULT_EXCEPTION_DESTINATION ) ) { newExceptionDestination = _defaultExceptionDestinationName ; usingDefault = true ; } } else { newExceptionDestination = _defaultExceptionDestinationName ; usingDefault = true ; } try { DestinationHandler exceptionDestHandler = _messageProcessor . getDestinationManager ( ) . getDestination ( newExceptionDestination , true ) ; rc = exceptionDestHandler . checkCanAcceptMessage ( null , null ) ; } catch ( SIException e ) { SibTr . exception ( tc , e ) ; } if ( rc != DestinationHandler . OUTPUT_HANDLER_FOUND && ! usingDefault ) { try { DestinationHandler exceptionDestHandler = _messageProcessor . getDestinationManager ( ) . getDestination ( _defaultExceptionDestinationName , true ) ; rc = exceptionDestHandler . checkCanAcceptMessage ( null , null ) ; } catch ( SIException e ) { SibTr . exception ( tc , e ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkCanExceptionMessage" , Integer . valueOf ( rc ) ) ; return rc ; }
Check whether it will be possible to place a message on the exception destination .
37,703
public UndeliverableReturnCode handleUndeliverableMessage ( SIBusMessage msg , String alternateUser , TransactionCommon tran , int exceptionReason , String [ ] exceptionStrings ) { return handleUndeliverableMessage ( msg , alternateUser , tran , exceptionReason , exceptionStrings , null ) ; }
Wrapper method for handleUndeliverableMessage . This version will be called from an external component via the com . ibm . ws . sib . processor . ExceptionDestinationHandler interface . E . g . we need to access this routine from the MQLink in the comms component .
37,704
private UndeliverableReturnCode checkMessage ( SIMPMessage message ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkMessage" , message ) ; UndeliverableReturnCode rc = UndeliverableReturnCode . OK ; Reliability discardReliabilityThreshold = Reliability . BEST_EFFORT_NONPERSISTENT ; if ( _originalDestination != null ) discardReliabilityThreshold = _originalDestination . getExceptionDiscardReliability ( ) ; if ( message . getReliability ( ) . compareTo ( discardReliabilityThreshold ) <= 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Message reliability (" + message . getReliability ( ) + ") <= Exception reliability (" + discardReliabilityThreshold + ")" ) ; rc = UndeliverableReturnCode . DISCARD ; } else if ( _originalDestination != null && _originalDestination . isTemporary ( ) ) rc = UndeliverableReturnCode . DISCARD ; else if ( Boolean . TRUE . equals ( message . getMessage ( ) . getReportDiscardMsg ( ) ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Message discarded at sender's request" ) ; rc = UndeliverableReturnCode . DISCARD ; } else if ( isBlockRequired ( message ) ) rc = UndeliverableReturnCode . BLOCK ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkMessage" , rc ) ; return rc ; }
Checks that a message is valid for delivery to an exception destination
37,705
private AccessResult checkExceptionDestinationAccess ( JsMessage msg , ConnectionImpl conn , String alternateUser , boolean defaultInUse ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkExceptionDestinationAccess" , new Object [ ] { msg , conn , alternateUser , Boolean . valueOf ( defaultInUse ) } ) ; SecurityContext secContext = new SecurityContext ( msg , alternateUser , null , _messageProcessor . getAuthorisationUtils ( ) ) ; boolean allowed = true ; boolean identityAdoptionAllowed = true ; if ( defaultInUse ) { if ( conn != null ) { SecurityContext connSecContext = new SecurityContext ( conn . getSecuritySubject ( ) , alternateUser , null , _messageProcessor . getAuthorisationUtils ( ) ) ; if ( alternateUser != null ) { if ( ! _messageProcessor . getAccessChecker ( ) . checkDestinationAccess ( connSecContext , null , SIMPConstants . SYSTEM_DEFAULT_EXCEPTION_DESTINATION_PREFIX , OperationType . IDENTITY_ADOPTER ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "checkExceptionDestinationAccess" , "not authorized to perform alternate user checks on this destination" ) ; allowed = false ; identityAdoptionAllowed = false ; } } if ( allowed ) { if ( ! _messageProcessor . getAccessChecker ( ) . checkDestinationAccess ( connSecContext , null , SIMPConstants . SYSTEM_DEFAULT_EXCEPTION_DESTINATION_PREFIX , OperationType . SEND ) ) { allowed = false ; } } } else { if ( ! _messageProcessor . getAccessChecker ( ) . checkDestinationAccess ( secContext , null , SIMPConstants . SYSTEM_DEFAULT_EXCEPTION_DESTINATION_PREFIX , OperationType . SEND ) ) { allowed = false ; } } } else { if ( conn != null ) { SecurityContext connSecContext = new SecurityContext ( conn . getSecuritySubject ( ) , alternateUser , null , _messageProcessor . getAuthorisationUtils ( ) ) ; if ( alternateUser != null ) { if ( ! _exceptionDestination . checkDestinationAccess ( connSecContext , OperationType . IDENTITY_ADOPTER ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "checkExceptionDestinationAccess" , "not authorized to perform alternate user checks on this destination" ) ; allowed = false ; identityAdoptionAllowed = false ; } } if ( allowed ) { if ( ! _exceptionDestination . checkDestinationAccess ( connSecContext , OperationType . SEND ) ) { allowed = false ; } } } else { if ( ! _exceptionDestination . checkDestinationAccess ( secContext , OperationType . SEND ) ) { allowed = false ; } } } AccessResult result = new AccessResult ( allowed , identityAdoptionAllowed ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkExceptionDestinationAccess" , result ) ; return result ; }
Checks authority to access exception destination .
37,706
private void handleAccessDenied ( AccessResult result , JsMessage msg , String alternateUser ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "handleAccessDenied" , new Object [ ] { result , msg , alternateUser } ) ; String userName = null ; OperationType operationType = null ; if ( result . didIdentityAdoptionFail ( ) ) { userName = msg . getSecurityUserid ( ) ; operationType = OperationType . IDENTITY_ADOPTER ; } else { operationType = OperationType . SEND ; if ( alternateUser != null ) userName = alternateUser ; else userName = msg . getSecurityUserid ( ) ; } String nlsMessage = nls . getFormattedMessage ( "USER_NOT_AUTH_EXCEPTION_DEST_ERROR_CWSIP0313" , new Object [ ] { userName , _exceptionDestinationName } , null ) ; _messageProcessor . getAccessChecker ( ) . fireDestinationAccessNotAuthorizedEvent ( _exceptionDestinationName , userName , operationType , nlsMessage ) ; SibTr . warning ( tc , "USER_NOT_AUTH_EXCEPTION_DEST_ERROR_CWSIP0313" , new Object [ ] { userName , _exceptionDestinationName } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "handleAccessDenied" ) ; }
Fire an event if eventing is enabled and write an audit record .
37,707
private void fireMessageExceptionedEvent ( String apiMsgId , SIMPMessage message , int exceptionReason ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "fireMessageExceptionedEvent" , new Object [ ] { apiMsgId , message , Integer . valueOf ( exceptionReason ) } ) ; JsMessagingEngine me = _messageProcessor . getMessagingEngine ( ) ; RuntimeEventListener listener = _messageProcessor . getRuntimeEventListener ( ) ; String systemMessageId = message . getMessage ( ) . getSystemMessageId ( ) ; if ( listener != null ) { String nlsMessage = nls_mt . getFormattedMessage ( "MESSAGE_EXCEPTION_DESTINATIONED_CWSJU0012" , new Object [ ] { apiMsgId , systemMessageId , _exceptionDestinationName , Integer . valueOf ( exceptionReason ) , message . getMessage ( ) . getExceptionMessage ( ) } , null ) ; Properties props = new Properties ( ) ; String intendedDestinationName = "" ; String intendedDestinationUuid = SIBUuid12 . toZeroString ( ) ; if ( _originalDestination != null ) { intendedDestinationName = _originalDestination . getName ( ) ; intendedDestinationUuid = _originalDestination . getUuid ( ) . toString ( ) ; } props . put ( SibNotificationConstants . KEY_INTENDED_DESTINATION_NAME , intendedDestinationName ) ; props . put ( SibNotificationConstants . KEY_INTENDED_DESTINATION_UUID , intendedDestinationUuid ) ; props . put ( SibNotificationConstants . KEY_EXCEPTION_DESTINATION_NAME , _exceptionDestination . getName ( ) ) ; props . put ( SibNotificationConstants . KEY_EXCEPTION_DESTINATION_UUID , _exceptionDestination . getUuid ( ) . toString ( ) ) ; props . put ( SibNotificationConstants . KEY_SYSTEM_MESSAGE_IDENTIFIER , ( systemMessageId == null ) ? "" : systemMessageId ) ; props . put ( SibNotificationConstants . KEY_MESSAGE_EXCEPTION_REASON , String . valueOf ( exceptionReason ) ) ; listener . runtimeEventOccurred ( me , SibNotificationConstants . TYPE_SIB_MESSAGE_EXCEPTIONED , nlsMessage , props ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Null RuntimeEventListener, cannot fire event" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "fireMessageExceptionedEvent" ) ; }
Fire an event notification of type TYPE_SIB_MESSAGE_EXCEPTIONED
37,708
public static String decodeUri ( String url ) { int index1 = url . indexOf ( sessUrlRewritePrefix ) ; int index2 = url . indexOf ( qMark ) ; String tmp = null ; if ( index2 != - 1 && index2 > index1 ) { tmp = url . substring ( index2 ) ; } if ( index1 != - 1 ) { url = url . substring ( 0 , index1 ) ; if ( tmp != null ) { url = url + tmp ; } } return url ; }
Strips out the sessionId only form the URI
37,709
public static final void setInstance ( FaceletFactory factory ) { if ( factory == null ) { instance . remove ( ) ; } else { instance . set ( factory ) ; } }
Set the static instance
37,710
protected Object getSession ( String id , int version , boolean isSessionAccess , boolean forceSessionRetrieval , Object xdCorrelator ) { if ( isSessionAccess ) { if ( version == - 1 ) { _store . refreshSession ( id , xdCorrelator ) ; } else { _store . refreshSession ( id , version , xdCorrelator ) ; } } ISession iSession = getSessionFromStore ( id , version , isSessionAccess , forceSessionRetrieval , xdCorrelator ) ; if ( iSession != null ) { if ( isSessionAccess ) { boolean stillValid = _store . checkSessionStillValid ( iSession , iSession . getLastAccessedTime ( ) ) ; if ( stillValid ) { iSession . incrementRefCount ( ) ; _sessionEventDispatcher . sessionAccessed ( iSession ) ; } else { iSession = null ; } } } else { if ( isSessionAccess ) { _sessionEventDispatcher . sessionAccessUnknownKey ( id ) ; } } return iSession ; }
forceSessionRetrieval can only be true when using applicationSessions
37,711
public static byte [ ] copyCredToken ( byte [ ] credToken ) { if ( credToken == null ) { return null ; } final int LEN = credToken . length ; if ( LEN == 0 ) { return new byte [ LEN ] ; } byte [ ] newCredToken = new byte [ LEN ] ; System . arraycopy ( credToken , 0 , newCredToken , 0 , LEN ) ; return newCredToken ; }
Create a copy of the specified byte array .
37,712
public static X509Certificate [ ] copyCertChain ( X509Certificate [ ] certChain ) { if ( certChain == null ) { return null ; } final int LEN = certChain . length ; if ( LEN == 0 ) { return new X509Certificate [ LEN ] ; } X509Certificate [ ] newCertChain = new X509Certificate [ LEN ] ; System . arraycopy ( certChain , 0 , newCertChain , 0 , LEN ) ; return newCertChain ; }
Create a copy of the specified cert array .
37,713
public void waitOnChains ( long quiesceTimeout ) { ChannelFramework cf = ChannelFrameworkFactory . getChannelFramework ( ) ; int elapsedTime = 0 ; if ( waitingChainNames . size ( ) > 0 && elapsedTime < quiesceTimeout ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Waiting on " + waitingChainNames . size ( ) + " chain(s) to stop" ) ; } Iterator < String > iter = waitingChainNames . iterator ( ) ; while ( iter . hasNext ( ) ) { if ( ! cf . isChainRunning ( iter . next ( ) ) ) iter . remove ( ) ; } try { Thread . sleep ( 1000 ) ; } catch ( InterruptedException ie ) { } elapsedTime += 1000 ; } }
Poll the list of chains until they re stopped or the quiesce timeout is hit
37,714
static void closeLink ( CommsConnection conn ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "closeLink" , conn ) ; conn . setSchemaSet ( null ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "closeLink" ) ; }
Called when a connection closes .
37,715
static byte [ ] receiveHandshake ( CommsConnection conn , byte [ ] data ) throws JMFException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "receiveHandshake" , conn ) ; Coder coder = new Coder ( data ) ; conn . setSchemaSet ( makeSchemaIdSet ( coder ) ) ; byte [ ] ids = makeSchemaIdList ( JMFRegistry . instance . retrieveAll ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "receiveHandshake" ) ; return ids ; }
Called when schema ids are received during an initial handshake
37,716
static void receiveSchemas ( CommsConnection conn , byte [ ] data ) throws JMFException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "receiveSchemas" , conn ) ; final SchemaSet ids ; try { ids = ( SchemaSet ) conn . getSchemaSet ( ) ; if ( ids == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "getSchemaSet() returned null for CommsConnection: " + conn ) ; throw new IllegalStateException ( "CommsConnection returned null SchemaSet" ) ; } } catch ( SIConnectionDroppedException e ) { throw new IllegalStateException ( "CommsConnection threw exception" , e ) ; } Coder coder = new Coder ( data ) ; addSchemaDefinitions ( ids , coder ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "receiveSchemas" ) ; }
Called when schema definitions are received on a connection
37,717
static void sendSchemas ( CommsConnection conn , JMFSchema [ ] schemas ) throws SIConnectionLostException , SIConnectionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "sendSchemas" , conn ) ; SchemaSet ids = ( SchemaSet ) conn . getSchemaSet ( ) ; if ( ids == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "getSchemaSet() returned null for CommsConnection: " + conn ) ; throw new IllegalStateException ( "CommsConnection returned null SchemaSet" ) ; } JMFSchema [ ] missing = new JMFSchema [ schemas . length ] ; int count = 0 ; for ( int i = 0 ; i < schemas . length ; i ++ ) { if ( ! ids . contains ( schemas [ i ] . getLongID ( ) ) ) missing [ count ++ ] = schemas [ i ] ; } if ( count > 0 ) { conn . sendMFPSchema ( makeSchemaDefinitionList ( missing , count ) ) ; for ( int i = 0 ; i < count ; i ++ ) ids . add ( missing [ i ] . getLongID ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendSchemas" ) ; }
Called when sending a message on a connection to check for and send any missing schemas
37,718
private static void addSchemaDefinitions ( SchemaSet ids , Coder coder ) throws JMFException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Decoding " + coder . count + "new schema definitions" ) ; for ( int i = 0 ; i < coder . count ; i ++ ) { int length = ArrayUtil . readInt ( coder . buffer , coder . offset ) ; coder . offset += ArrayUtil . INT_SIZE ; JMFSchema schema = JMFRegistry . instance . createJMFSchema ( coder . buffer , coder . offset , length ) ; JMFRegistry . instance . register ( schema ) ; ids . add ( schema . getLongID ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , " Added Schema " + debugSchema ( schema ) ) ; coder . offset += length ; } }
Add extra incoming schema definitions
37,719
public void cleanUpSubject ( ) { if ( temporarySubject != null ) { AccessController . doPrivileged ( new PrivilegedAction < Object > ( ) { public Object run ( ) { removeSubjectPrincipals ( ) ; removeSubjectPublicCredentials ( ) ; removeSubjectPrivateCredentials ( ) ; return null ; } } ) ; } temporarySubject = null ; }
Common Subject clean up .
37,720
protected void payloadWritten ( int payloadSize ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "payloadWritten" , new Object [ ] { this , new Integer ( payloadSize ) } ) ; _unwrittenDataSize -= payloadSize ; if ( _unwrittenDataSize == 0 ) { _recUnit . payloadWritten ( payloadSize + HEADER_SIZE ) ; } else { _recUnit . payloadWritten ( payloadSize ) ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "unwrittenDataSize = " + _unwrittenDataSize + " totalDataSize = " + _totalDataSize ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "payloadWritten" ) ; }
Informs the recoverable unit section that previously unwritten data has been written to disk by one of its data items and no longer needs to be tracked in the unwritten data field . The recoverable unit must use the supplied information to track the amount of unwritten active data it holds . This information must be passed to its parent recovery log in order that it may track the amount of unwritten data in the entire recovery log .
37,721
protected void payloadDeleted ( int totalPayloadSize , int unwrittenPayloadSize ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "payloadDeleted" , new Object [ ] { this , new Integer ( totalPayloadSize ) , new Integer ( unwrittenPayloadSize ) } ) ; _totalDataSize -= totalPayloadSize ; _unwrittenDataSize -= unwrittenPayloadSize ; if ( _unwrittenDataSize == 0 && ( unwrittenPayloadSize != 0 ) ) { unwrittenPayloadSize += HEADER_SIZE ; } if ( _totalDataSize == 0 ) { totalPayloadSize += HEADER_SIZE ; } _recUnit . payloadDeleted ( totalPayloadSize , unwrittenPayloadSize ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "unwrittenDataSize = " + _unwrittenDataSize + " totalDataSize = " + _totalDataSize ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "payloadDeleted" ) ; }
Informs the recoverable unit section that data has been removed . At present this method is only used by the SingleDataItem class to remove the payload required for the its data before adding back additional payload back again for the replacement data data .
37,722
public BeanId getBeanId ( ) { if ( ivBeanId == null ) { ivBeanId = new BeanId ( ivBMD . j2eeName , null , false ) ; } return ivBeanId ; }
Gets the partially formed BeanId for this bean . The resulting BeanId will not have a home reference .
37,723
protected String promptForText ( com . ibm . ws . security . audit . reader . utils . ConsoleWrapper stdin , PrintStream stdout ) { return promptForText ( stdin , stdout , "encode.enterText" , "encode.reenterText" , "encode.readError" , "encode.entriesDidNotMatch" ) ; }
Prompt the user to enter text to encode . Prompts twice and compares to ensure it was entered correctly .
37,724
public static String getPropertyOrNull ( String name ) { try { return AccessController . doPrivileged ( new SystemPropertyAction ( name ) ) ; } catch ( SecurityException ex ) { LOG . log ( Level . FINE , "SecurityException raised getting property " + name , ex ) ; return null ; } }
Get the system property via the AccessController but if a SecurityException is raised just return null ;
37,725
public MatchTarget duplicate ( ) { try { return ( MatchTarget ) clone ( ) ; } catch ( CloneNotSupportedException e ) { FFDC . processException ( cclass , "com.ibm.ws.sib.matchspace.MatchTarget.duplicate" , e , "1:112:1.15" ) ; throw new IllegalStateException ( ) ; } }
Creates a clone of this MatchTarget . Override only if the system clone support does not produce a correct result .
37,726
public EJBBinding createBindingObject ( HomeRecord hr , HomeWrapperSet homeSet , String interfaceName , int interfaceIndex , boolean local ) { return new EJBBinding ( hr , interfaceName , interfaceIndex , local ) ; }
Store the binding information for later use .
37,727
public EJBBinding createJavaBindingObject ( HomeRecord hr , HomeWrapperSet homeSet , String interfaceName , int interfaceIndex , boolean local , EJBBinding bindingObject ) { return bindingObject ; }
This method is provided for tWas and is not used for Liberty . Just return the bindingObject for now .
37,728
protected Class < ? > loadClass ( String className , boolean resolve ) throws ClassNotFoundException { Class < ? > loadedClass = null ; synchronized ( this ) { loadedClass = findLoadedClass ( className ) ; if ( loadedClass == null ) { int index = className . lastIndexOf ( '.' ) ; String packageName = index > 0 ? className . substring ( 0 , index ) : "" ; if ( packageList . contains ( packageName ) ) { try { loadedClass = findClass ( className ) ; } catch ( ClassNotFoundException cnfe ) { } } } } if ( null == loadedClass ) { loadedClass = super . loadClass ( className , resolve ) ; } return loadedClass ; }
load class from the local classpath first and the class was not found load from parent or system classload again .
37,729
public DERObject getConvertedValue ( DERObjectIdentifier oid , String value ) { if ( value . length ( ) != 0 && value . charAt ( 0 ) == '#' ) { try { return convertHexEncoded ( value , 1 ) ; } catch ( IOException e ) { throw new RuntimeException ( "can't recode value for oid " + oid . getId ( ) , e ) ; } } else if ( oid . equals ( X509Name . EmailAddress ) ) { return new DERIA5String ( value ) ; } else if ( canBePrintable ( value ) ) { return new DERPrintableString ( value ) ; } else if ( canBeUTF8 ( value ) ) { return new DERUTF8String ( value ) ; } return new DERBMPString ( value ) ; }
Apply default coversion for the given value depending on the oid and the character range of the value .
37,730
public byte [ ] transform ( ClassLoader loader , String className , Class < ? > classBeingRedefined , ProtectionDomain protectionDomain , byte [ ] classfileBuffer ) throws IllegalClassFormatException { if ( ( loader == null && ! includeBootstrap ) || probeManagerImpl . isExcludedClass ( className ) ) { return null ; } if ( probeManagerImpl . isProbeCandidate ( className ) ) { return transformCandidate ( classfileBuffer ) ; } return null ; }
Perform necessary transformation to hook static initializers of probe candidates .
37,731
public synchronized void setStoreFileSize ( long newMinimumStoreFileSize , long newMaximumStoreFileSize ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "setStoreFileSize" , new Object [ ] { new Long ( newMinimumStoreFileSize ) , new Long ( newMaximumStoreFileSize ) } ) ; if ( newMinimumStoreFileSize > newMaximumStoreFileSize ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "setStoreFileSize" ) ; throw new IllegalArgumentException ( newMinimumStoreFileSize + ">" + newMaximumStoreFileSize ) ; } if ( newMaximumStoreFileSize < storeFileSizeUsed ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "setStoreFileSize" , new Object [ ] { new Long ( newMaximumStoreFileSize ) , new Long ( storeFileSizeAllocated ) , new Long ( storeFileSizeUsed ) } ) ; throw new StoreFileSizeTooSmallException ( this , newMaximumStoreFileSize , storeFileSizeAllocated , storeFileSizeUsed ) ; } if ( newMinimumStoreFileSize > storeFileSizeAllocated ) { try { setStoreFileSizeInternalWithException ( newMinimumStoreFileSize ) ; } catch ( java . io . IOException exception ) { ObjectManager . ffdc . processException ( this , cclass , "setStoreFileSize" , exception , "1:349:1.57" ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "setStoreFileSize" ) ; throw new PermanentIOException ( this , exception ) ; } } minimumStoreFileSize = newMinimumStoreFileSize ; maximumStoreFileSize = newMaximumStoreFileSize ; writeHeader ( ) ; force ( ) ; setAllocationAllowed ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "setStoreFileSize" ) ; }
Sets the size of the store file to the new values . At least the minimum space is reserved in the file system . No more than the maximum number of bytes will be used . Blocks until this has completed . The initial values used by the ObjecStore are 0 and Long . MAX_VAULE . The store will attempt to release space as ManagedObjects are deleted to reach the minimum size .
37,732
public synchronized void setCachedManagedObjectsSize ( int cachedManagedObjectsSize ) throws ObjectManagerException { this . cachedManagedObjectsSize = cachedManagedObjectsSize ; cachedManagedObjects = new java . lang . ref . SoftReference [ cachedManagedObjectsSize ] ; writeHeader ( ) ; force ( ) ; }
Causes all curently cached ManagedObjects to be dropped .
37,733
protected void setAllocationAllowed ( ) throws ObjectManagerException { final String methodName = "setAllocationAllowed" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { new Long ( storeFileSizeAllocated ) , new Long ( storeFileSizeUsed ) } ) ; long storeFileSizeRequired = storeFileSizeAllocated ; if ( simulateFullReservedSize > 0 ) { allocationAllowed = false ; reservationThreshold = 0 ; } else { long currentReservedSize = reservedSize . get ( ) ; long pesimisticSpaceRequired = Math . max ( objectManagerState . logOutput . getLogFileSize ( ) , objectManagerState . logOutput . getLogFileSizeRequested ( ) ) + directoryReservedSize + currentReservedSize ; long largestFreeSpace = 0 ; if ( freeSpaceByLength . size ( ) > 0 ) { largestFreeSpace = ( ( FreeSpace ) freeSpaceByLength . last ( ) ) . length ; } if ( pesimisticSpaceRequired <= largestFreeSpace ) { allocationAllowed = true ; } else { storeFileSizeRequired = storeFileSizeUsed + pesimisticSpaceRequired ; if ( storeFileSizeRequired <= storeFileSizeAllocated ) { allocationAllowed = true ; } else if ( storeFileSizeRequired <= maximumStoreFileSize ) { allocationAllowed = setStoreFileSizeInternal ( storeFileSizeRequired ) ; } else { if ( storeFileSizeAllocated < maximumStoreFileSize ) setStoreFileSizeInternal ( maximumStoreFileSize ) ; allocationAllowed = false ; numberOfStoreFullCheckpointsTriggered ++ ; objectManagerState . requestCheckpoint ( persistent ) ; } reservationThreshold = storeFileSizeAllocated - storeFileSizeUsed - directoryReservedSize ; reservationCheckpointThreshold = Math . min ( reservationThreshold , currentReservedSize + reservationCheckpointMaximum ) ; } } if ( reservationPacing ) { synchronized ( reservationPacingLock ) { reservationPacing = false ; reservationPacingLock . notify ( ) ; } } if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , new Object [ ] { new Boolean ( allocationAllowed ) , new Long ( storeFileSizeRequired ) } ) ; }
Tests to see if allocation of new Objects should be allowed or not . Caller must be synchronized on this .
37,734
public final void reserve ( int deltaSize , boolean paced ) throws ObjectManagerException { final String methodName = "reserve" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { new Integer ( deltaSize ) , new Boolean ( paced ) } ) ; long newReservedSize = reservedSize . addAndGet ( deltaSize ) ; if ( newReservedSize > reservationCheckpointThreshold ) { numberOfReservationCheckpointsTriggered ++ ; objectManagerState . requestCheckpoint ( persistent ) ; if ( paced ) { synchronized ( reservationPacingLock ) { while ( newReservedSize > reservationCheckpointThreshold && reservationPacing && paced ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , methodName , new Object [ ] { "wait:728" , new Long ( newReservedSize ) , new Long ( reservationCheckpointThreshold ) , new Long ( reservationThreshold ) , new Boolean ( reservationPacing ) } ) ; try { newReservedSize = reservedSize . addAndGet ( - deltaSize ) ; reservationPacingLock . wait ( ) ; } catch ( InterruptedException exception ) { ObjectManager . ffdc . processException ( this , cclass , methodName , exception , "1:739:1.57" ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , exception ) ; throw new UnexpectedExceptionException ( this , exception ) ; } finally { newReservedSize = reservedSize . addAndGet ( deltaSize ) ; } } if ( newReservedSize > reservationCheckpointThreshold && ( objectManagerState . state == ObjectManagerState . stateColdStarted || objectManagerState . state == ObjectManagerState . stateWarmStarted ) ) { reservationPacing = true ; } else { reservationPacing = false ; reservationPacingLock . notify ( ) ; } } } if ( newReservedSize > reservationThreshold ) { synchronized ( this ) { setAllocationAllowed ( ) ; if ( newReservedSize > ( storeFileSizeAllocated - storeFileSizeUsed - directoryReservedSize ) ) { if ( objectManagerState . getObjectManagerStateState ( ) == ObjectManagerState . stateReplayingLog || deltaSize <= 0 ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , methodName , new Object [ ] { "Objectstorefull exception supressed:783" , new Long ( newReservedSize ) } ) ; } else { reservedSize . addAndGet ( - deltaSize ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , new Object [ ] { new Long ( newReservedSize ) } ) ; throw new ObjectStoreFullException ( this , null ) ; } } } } } else if ( reservationPacing ) { synchronized ( reservationPacingLock ) { pacedReservationsReleased ++ ; reservationPacing = false ; reservationPacingLock . notify ( ) ; } } if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ; }
Space accounting .
37,735
public void simulateFull ( boolean isFull ) throws ObjectManagerException { final String methodName = "simulateFull" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { new Boolean ( isFull ) } ) ; if ( isFull ) { objectManagerState . waitForCheckpoint ( true ) ; synchronized ( this ) { long available = storeFileSizeAllocated - storeFileSizeUsed - directoryReservedSize - reservedSize . get ( ) ; long newReservedSize = reservedSize . addAndGet ( ( int ) available ) ; simulateFullReservedSize = simulateFullReservedSize + available ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , methodName , new Object [ ] { "isFull:834" , new Long ( available ) , new Long ( newReservedSize ) , new Long ( simulateFullReservedSize ) } ) ; } } else { synchronized ( this ) { reservedSize . addAndGet ( ( int ) - simulateFullReservedSize ) ; simulateFullReservedSize = 0 ; } objectManagerState . waitForCheckpoint ( true ) ; } if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , new Object [ ] { new Long ( simulateFullReservedSize ) } ) ; }
When enabled reserve requests to this ObjectStore will throw ObjectStoreFullException .
37,736
public synchronized void flush ( ) throws ObjectManagerException { final String methodName = "flush" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName ) ; if ( storeStrategy == STRATEGY_SAVE_ONLY_ON_SHUTDOWN ) { if ( objectManagerState . getObjectManagerStateState ( ) != ObjectManagerState . stateStopped ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ; return ; } if ( objectManagerState . getTransactionIterator ( ) . hasNext ( ) ) { trace . warning ( this , cclass , methodName , "ObjectStore_UnsafeToFlush" , this ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ; return ; } } updateDirectory ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , methodName , "Release new free space" ) ; freeAllocatedSpace ( newFreeSpace ) ; if ( gatherStatistics ) { long now = System . currentTimeMillis ( ) ; releasingEntrySpaceMilliseconds += now - lastFlushMilliseconds ; lastFlushMilliseconds = now ; } directory . write ( ) ; if ( gatherStatistics ) { long now = System . currentTimeMillis ( ) ; directoryWriteMilliseconds += now - lastFlushMilliseconds ; lastFlushMilliseconds = now ; } writeFreeSpace ( ) ; if ( storeStrategy == STRATEGY_KEEP_ALWAYS ) force ( ) ; writeHeader ( ) ; if ( storeStrategy == STRATEGY_KEEP_ALWAYS ) force ( ) ; newFreeSpace . clear ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ; }
Writes buffered output to hardened storage . Blocks until this has completed .
37,737
private void updateDirectory ( ) throws ObjectManagerException { final String methodName = "updateDirectory" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName ) ; if ( checkpointManagedObjectsToWrite == null ) captureCheckpointManagedObjects ( ) ; checkpointReleaseSize = 0 ; if ( gatherStatistics ) lastFlushMilliseconds = System . currentTimeMillis ( ) ; for ( java . util . Iterator managedObjectIterator = checkpointManagedObjectsToWrite . values ( ) . iterator ( ) ; managedObjectIterator . hasNext ( ) ; ) { ManagedObject managedObject = ( ManagedObject ) managedObjectIterator . next ( ) ; cache ( managedObject ) ; write ( managedObject ) ; } checkpointManagedObjectsToWrite = null ; if ( gatherStatistics ) { long now = System . currentTimeMillis ( ) ; writingMilliseconds += now - lastFlushMilliseconds ; lastFlushMilliseconds = now ; } for ( java . util . Iterator tokenIterator = checkpointTokensToDelete . values ( ) . iterator ( ) ; tokenIterator . hasNext ( ) ; ) { Token token = ( Token ) tokenIterator . next ( ) ; Directory . StoreArea storeArea = ( Directory . StoreArea ) directory . removeEntry ( new Long ( token . storedObjectIdentifier ) ) ; if ( storeArea != null ) newFreeSpace . add ( storeArea ) ; } checkpointTokensToDelete = null ; if ( gatherStatistics ) { long now = System . currentTimeMillis ( ) ; removingEntriesMilliseconds += now - lastFlushMilliseconds ; lastFlushMilliseconds = now ; } if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , methodName , "Reserve space for the direcory and new free space map" ) ; directory . reserveSpace ( ) ; if ( gatherStatistics ) { long now = System . currentTimeMillis ( ) ; allocatingEntrySpaceMilliseconds += now - lastFlushMilliseconds ; lastFlushMilliseconds = now ; } if ( freeSpaceStoreArea != null && freeSpaceStoreArea . length != 0 ) newFreeSpace . add ( freeSpaceStoreArea ) ; long newFreeSpaceLength = ( freeSpaceByLength . size ( ) + newFreeSpace . size ( ) ) * freeSpaceEntryLength ; FreeSpace newFreeSpaceArea = allocateSpace ( newFreeSpaceLength ) ; freeSpaceStoreArea = directory . makeStoreArea ( freeSpaceIdentifier , newFreeSpaceArea . address , newFreeSpaceArea . length ) ; directoryReservedSize = directory . spaceRequired ( ) ; reservedSize . addAndGet ( - checkpointReleaseSize ) ; setAllocationAllowed ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ; }
Capture the objects we will write and delete . Update the directory and freeSpaceMap . Do not overwrite any existing data because we need to have the before and after versions available until we flip over to the after version when we rewrite the header . 1 ) Update the directory . 2 ) Allocate new space for the directory and the free space map .
37,738
FreeSpace allocateSpace ( long lengthRequired ) throws ObjectManagerException { final String methodName = "allocateSpace" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { new Long ( lengthRequired ) } ) ; FreeSpace freeSpace ; java . util . SortedSet tailSet = freeSpaceByLength . tailSet ( new FreeSpace ( 0 , lengthRequired ) ) ; if ( ! tailSet . isEmpty ( ) ) { freeSpace = ( FreeSpace ) tailSet . first ( ) ; tailSet . remove ( freeSpace ) ; long remainingLength = freeSpace . length - lengthRequired ; if ( remainingLength < minimumFreeSpaceEntrySize ) { if ( freeSpace . prev != null ) { freeSpace . prev . next = freeSpace . next ; } else { freeSpaceByAddressHead = freeSpace . next ; } if ( freeSpace . next != null ) { freeSpace . next . prev = freeSpace . prev ; } freeSpace . prev = freeSpace . next = null ; } else { freeSpace . length = remainingLength ; freeSpaceByLength . add ( freeSpace ) ; freeSpace = new FreeSpace ( freeSpace . address + remainingLength , lengthRequired ) ; } } else { freeSpace = new FreeSpace ( storeFileSizeUsed , lengthRequired ) ; long newStoreFileSizeUsed = storeFileSizeUsed + lengthRequired ; if ( newStoreFileSizeUsed > storeFileSizeAllocated ) { storeFileExtendedDuringAllocation ++ ; if ( storeStrategy == STRATEGY_KEEP_ALWAYS && ( objectManagerState . logFileType == ObjectManager . LOG_FILE_TYPE_FILE || objectManagerState . logFileType == ObjectManager . LOG_FILE_TYPE_CLEAR ) ) { ObjectManager . ffdc . processException ( this , cclass , methodName , new Exception ( "Extended allocated file" ) , "1:1437:1.57" , new Object [ ] { new Long ( newStoreFileSizeUsed ) , new Long ( storeFileSizeAllocated ) } ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , methodName , new Object [ ] { "STRATEGY_KEEP_ALWAYS:1440" , new Long ( newStoreFileSizeUsed ) , new Long ( storeFileSizeAllocated ) } ) ; } if ( newStoreFileSizeUsed <= maximumStoreFileSize && setStoreFileSizeInternal ( newStoreFileSizeUsed ) ) { } else { allocationAllowed = false ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , new Object [ ] { "ObjectStoreFull" } ) ; throw new ObjectStoreFullException ( this , null ) ; } } storeFileSizeUsed = newStoreFileSizeUsed ; } if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , new Object [ ] { freeSpace } ) ; return freeSpace ; }
Allocate space in the file .
37,739
public Map < String , ProvisioningFeatureDefinition > getFeatureDefinitions ( String productName ) { if ( productName . equals ( CORE_PRODUCT_NAME ) ) { return getCoreProductFeatureDefinitions ( ) ; } else if ( productName . equals ( USR_PRODUCT_EXT_NAME ) ) { return getUsrProductFeatureDefinitions ( ) ; } else { return getProductExtFeatureDefinitions ( productName ) ; } }
Retrieves a map of features definitions associated with the specified product name .
37,740
public Map < String , ProvisioningFeatureDefinition > getCoreFeatureDefinitionsExceptPlatform ( ) { Map < String , ProvisioningFeatureDefinition > features = new TreeMap < String , ProvisioningFeatureDefinition > ( ) ; File featureDir = getCoreFeatureDir ( ) ; if ( ! featureDir . isDirectory ( ) && ! featureDir . mkdir ( ) ) { throw new FeatureToolException ( "Unable to find or create feature directory: " + featureDir , MessageFormat . format ( NLS . messages . getString ( "tool.feature.dir.not.found" ) , featureDir ) , null , ReturnCode . MISSING_CONTENT ) ; } File [ ] manifestFiles = featureDir . listFiles ( MFFilter ) ; if ( manifestFiles != null ) { for ( File file : manifestFiles ) { try { ProvisioningFeatureDefinition fd = new SubsystemFeatureDefinitionImpl ( ExtensionConstants . CORE_EXTENSION , file ) ; if ( fd . isSupportedFeatureVersion ( ) ) { features . put ( fd . getSymbolicName ( ) , fd ) ; } } catch ( IOException e ) { throw new FeatureToolException ( "Unable to read core feature manifest: " + file , ( String ) null , e , ReturnCode . BAD_FEATURE_DEFINITION ) ; } } } return features ; }
This API for install used only .
37,741
private Map < String , ProvisioningFeatureDefinition > getCoreProductFeatureDefinitions ( ) { Map < String , ProvisioningFeatureDefinition > features = new TreeMap < String , ProvisioningFeatureDefinition > ( ) ; File featureDir = getCoreFeatureDir ( ) ; if ( ! featureDir . isDirectory ( ) && ! featureDir . mkdir ( ) ) { throw new FeatureToolException ( "Unable to find or create feature directory: " + featureDir , MessageFormat . format ( NLS . messages . getString ( "tool.feature.dir.not.found" ) , featureDir ) , null , ReturnCode . MISSING_CONTENT ) ; } File platformDir = getCorePlatformDir ( ) ; File [ ] manifestFiles = featureDir . listFiles ( MFFilter ) ; if ( manifestFiles != null ) { for ( File file : manifestFiles ) { try { ProvisioningFeatureDefinition fd = new SubsystemFeatureDefinitionImpl ( ExtensionConstants . CORE_EXTENSION , file ) ; if ( fd . isSupportedFeatureVersion ( ) ) { features . put ( fd . getSymbolicName ( ) , fd ) ; } } catch ( IOException e ) { throw new FeatureToolException ( "Unable to read core feature manifest: " + file , ( String ) null , e , ReturnCode . BAD_FEATURE_DEFINITION ) ; } } } manifestFiles = platformDir . listFiles ( MFFilter ) ; if ( manifestFiles != null ) { for ( File file : manifestFiles ) { try { ProvisioningFeatureDefinition fd = new KernelFeatureListDefinition ( file ) ; features . put ( fd . getSymbolicName ( ) , fd ) ; } catch ( IOException e ) { throw new FeatureToolException ( "Unable to read core manifest: " + file , ( String ) null , e , ReturnCode . BAD_FEATURE_DEFINITION ) ; } } } return features ; }
Retrieves a Map of Liberty core features .
37,742
private Map < String , ProvisioningFeatureDefinition > getUsrProductFeatureDefinitions ( ) { Map < String , ProvisioningFeatureDefinition > features = null ; File userDir = Utils . getUserDir ( ) ; if ( userDir != null && userDir . exists ( ) ) { File userFeatureDir = new File ( userDir , USER_FEATURE_DIR ) ; if ( userFeatureDir . exists ( ) ) { features = new TreeMap < String , ProvisioningFeatureDefinition > ( ) ; File [ ] userManifestFiles = userFeatureDir . listFiles ( MFFilter ) ; if ( userManifestFiles != null ) { for ( File file : userManifestFiles ) { try { ProvisioningFeatureDefinition fd = new SubsystemFeatureDefinitionImpl ( USR_PRODUCT_EXT_NAME , file ) ; features . put ( fd . getSymbolicName ( ) , fd ) ; } catch ( IOException e ) { throw new FeatureToolException ( "Unable to read feature manifest from user extension: " + file , ( String ) null , e , ReturnCode . BAD_FEATURE_DEFINITION ) ; } } } } } return features ; }
Retrieves a Map of feature definitions in default usr product extension location
37,743
public String getProdFeatureLocation ( String productName ) { String location = null ; if ( productName . equals ( CORE_PRODUCT_NAME ) ) { location = Utils . getInstallDir ( ) . getAbsolutePath ( ) ; } else if ( productName . equals ( USR_PRODUCT_EXT_NAME ) ) { location = Utils . getUserDir ( ) . getAbsolutePath ( ) ; } else { readProductExtFeatureLocations ( ) ; if ( productExtNameInfoMap . containsKey ( productName ) ) { location = productExtNameInfoMap . get ( productName ) . getLocation ( ) ; } } return location ; }
Retrieves the location of the specified product name .
37,744
public String getProdFeatureId ( String productName ) { String productId = null ; if ( ! productName . equals ( CORE_PRODUCT_NAME ) && ! productName . equals ( USR_PRODUCT_EXT_NAME ) ) { readProductExtFeatureLocations ( ) ; if ( productExtNameInfoMap . containsKey ( productName ) ) { productId = productExtNameInfoMap . get ( productName ) . getProductID ( ) ; } } return productId ; }
Retrieves the ID of the specified product name .
37,745
public File getCoreFeatureDir ( ) { File featureDir = null ; File installDir = Utils . getInstallDir ( ) ; if ( installDir != null ) { featureDir = new File ( installDir , FEATURE_DIR ) ; } if ( featureDir == null ) { throw new RuntimeException ( "Feature Directory not found" ) ; } return featureDir ; }
Retrieves the Liberty core features directory .
37,746
public File getCorePlatformDir ( ) { File platformDir = null ; File installDir = Utils . getInstallDir ( ) ; if ( installDir != null ) { platformDir = new File ( installDir , PLATFORM_DIR ) ; } if ( platformDir == null ) { throw new RuntimeException ( "Platform Directory not found" ) ; } return platformDir ; }
Retrieves the Liberty core platform directory .
37,747
public File getCoreAssetDir ( ) { File assetDir = null ; File installDir = Utils . getInstallDir ( ) ; if ( installDir != null ) { assetDir = new File ( installDir , ASSET_DIR ) ; } if ( assetDir == null ) { throw new RuntimeException ( "Asset Directory not found" ) ; } return assetDir ; }
Retrieves the Liberty core assets directory .
37,748
public ContentBasedLocalBundleRepository getBundleRepository ( String featureName , WsLocationAdmin locService ) { return BundleRepositoryRegistry . getRepositoryHolder ( featureName ) . getBundleRepository ( ) ; }
Get bundle repository
37,749
@ FFDCIgnore ( { IllegalCharsetNameException . class , UnsupportedCharsetException . class } ) public static String mapCharset ( String enc , String deflt ) { if ( enc == null ) { return deflt ; } int idx = enc . indexOf ( ";" ) ; if ( idx != - 1 ) { enc = enc . substring ( 0 , idx ) ; } enc = charsetPattern . matcher ( enc ) . replaceAll ( "" ) . trim ( ) ; if ( "" . equals ( enc ) ) { return deflt ; } String newenc = encodings . get ( enc ) ; if ( newenc == null ) { try { newenc = Charset . forName ( enc ) . name ( ) ; } catch ( IllegalCharsetNameException icne ) { return null ; } catch ( UnsupportedCharsetException uce ) { return null ; } String tmpenc = encodings . putIfAbsent ( enc , newenc ) ; if ( tmpenc != null ) { newenc = tmpenc ; } } return newenc ; }
into something that is actually supported by Java and the Stax parsers and such .
37,750
public static void setUp ( ) throws Exception { LDAPUtils . addLDAPVariables ( server ) ; Log . info ( c , "setUp" , "Starting the server... (will wait for userRegistry servlet to start)" ) ; server . copyFileToLibertyInstallRoot ( "lib/features" , "internalfeatures/securitylibertyinternals-1.0.mf" ) ; server . addInstalledAppForValidation ( "userRegistry" ) ; server . startServer ( c . getName ( ) + ".log" ) ; assertNotNull ( "Application userRegistry does not appear to have started." , server . waitForStringInLog ( "CWWKZ0001I:.*userRegistry" ) ) ; assertNotNull ( "Security service did not report it was ready" , server . waitForStringInLog ( "CWWKS0008I" ) ) ; assertNotNull ( "Server did not came up" , server . waitForStringInLog ( "CWWKF0011I" ) ) ; Log . info ( c , "setUp" , "Creating servlet connection the server" ) ; servlet = new UserRegistryServletConnection ( server . getHostname ( ) , server . getHttpDefaultPort ( ) ) ; if ( servlet . getRealm ( ) == null ) { Thread . sleep ( 5000 ) ; servlet . getRealm ( ) ; } }
Updates the sample which is expected to be at the hard - coded path . If this test is failing check this path is correct .
37,751
public void getUserSecurityName ( ) throws Exception { String user = "vmmtestuser" ; String securityName = "cn=vmmtestuser,cn=users,dc=secfvt2,dc=austin,dc=ibm,dc=com" ; Log . info ( c , "getUserSecurityName" , "Checking with a valid user." ) ; LDAPFatUtils . assertDNsEqual ( "User security name didn't match expected value." , securityName , servlet . getUserSecurityName ( user ) ) ; }
Hit the test servlet to see if getUserSecurityName works when supplied with a valid user
37,752
public void initialRead ( ) { try { this . buffer = this . isc . getRequestBodyBuffer ( ) ; if ( null != this . buffer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Buffer returned from getRequestBodyBuffer : " + this . buffer ) ; } this . bytesRead += this . buffer . remaining ( ) ; } } catch ( IOException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Exception encountered during initialRead : " + e ) ; } } }
with the current set of data
37,753
private String encode ( PrintStream stderr , String plaintext , String encodingType , Map < String , String > properties ) throws InvalidPasswordEncodingException , UnsupportedCryptoAlgorithmException { String ret = null ; try { ret = PasswordUtil . encode ( plaintext , encodingType == null ? PasswordUtil . getDefaultEncoding ( ) : encodingType , properties ) ; } catch ( InvalidPasswordEncodingException e ) { e . printStackTrace ( stderr ) ; throw e ; } catch ( UnsupportedCryptoAlgorithmException e ) { e . printStackTrace ( stderr ) ; throw e ; } return ret ; }
Handle encoding of the plaintext provided . Capture any Exceptions and print the stack trace .
37,754
protected String getDescription ( JSONArray customInfoArray ) { StringBuffer sb = new StringBuffer ( ) ; sb . append ( getMessage ( "encode.option-custom.encryption" ) ) ; for ( int i = 0 ; i < customInfoArray . size ( ) ; i ++ ) { JSONObject customInfo = ( JSONObject ) customInfoArray . get ( i ) ; String name = ( String ) customInfo . get ( "name" ) ; sb . append ( getMessage ( "encode.option-desc.custom.feature" , name ) ) ; sb . append ( ( String ) customInfo . get ( "featurename" ) ) ; sb . append ( getMessage ( "encode.option-desc.custom.description" , name ) ) ; sb . append ( ( String ) customInfo . get ( "description" ) ) ; } return sb . toString ( ) ; }
Returns the message string of the custom encryption information .
37,755
private void extractFiles ( ArtifactMetadata artifactMetadata ) throws RepositoryArchiveIOException , RepositoryArchiveEntryNotFoundException , RepositoryArchiveException { _readmePayload = artifactMetadata . getFileWithExtension ( ".txt" ) ; if ( _readmePayload == null ) { throw new RepositoryArchiveEntryNotFoundException ( "Unable to find iFix readme .txt file in archive" + artifactMetadata . getArchive ( ) . getAbsolutePath ( ) , artifactMetadata . getArchive ( ) , "*.txt" ) ; } }
Extract the files from the zip
37,756
private String getFixId ( IFixInfo iFixInfo , ExtractedFileInformation xmlInfo ) throws RepositoryArchiveInvalidEntryException { if ( null == iFixInfo ) { throw new RepositoryArchiveInvalidEntryException ( "Null XML object provided" , xmlInfo . getSourceArchive ( ) , xmlInfo . getSelectedPathFromArchive ( ) ) ; } return iFixInfo . getId ( ) ; }
Get the ID of the iFix from the Java representation of the iFix XML
37,757
private List < String > getProvides ( IFixInfo iFixInfo , ParserBase . ExtractedFileInformation xmlInfo ) throws RepositoryArchiveInvalidEntryException { if ( null == iFixInfo ) { throw new RepositoryArchiveInvalidEntryException ( "Null document provided" , xmlInfo . getSourceArchive ( ) , xmlInfo . getSelectedPathFromArchive ( ) ) ; } Resolves resolves = iFixInfo . getResolves ( ) ; if ( null == resolves ) { throw new RepositoryArchiveInvalidEntryException ( "Document does not contain a \"resolves\" node" , xmlInfo . getSourceArchive ( ) , xmlInfo . getSelectedPathFromArchive ( ) ) ; } List < String > retList = new ArrayList < String > ( ) ; List < Problem > problems = resolves . getProblems ( ) ; if ( problems != null ) { for ( Problem problem : problems ) { String displayId = problem . getDisplayId ( ) ; if ( null == displayId ) { throw new RepositoryArchiveInvalidEntryException ( "Unexpected null getting APAR id" , xmlInfo . getSourceArchive ( ) , xmlInfo . getSelectedPathFromArchive ( ) ) ; } retList . add ( displayId ) ; } } return retList ; }
Get a list of the APARs fixed by this iFix
37,758
private String parseManifestForAppliesTo ( File file ) throws RepositoryArchiveIOException { Manifest mf = null ; try ( JarFile jar = new JarFile ( file ) ) { try { mf = jar . getManifest ( ) ; } catch ( IOException ioe ) { throw new RepositoryArchiveIOException ( "Error getting manifest from jar " + jar . getName ( ) , new File ( jar . getName ( ) ) , ioe ) ; } } catch ( IOException ioe ) { throw new RepositoryArchiveIOException ( "Unable to create JarFile from path " + file , new File ( file . getName ( ) ) , ioe ) ; } String appliesTo = null ; Attributes mainattrs = mf . getMainAttributes ( ) ; for ( Object at : mainattrs . keySet ( ) ) { String attribName = ( ( Attributes . Name ) at ) . toString ( ) ; String attribValue = ( String ) mainattrs . get ( at ) ; if ( APPLIES_TO . equals ( attribName ) ) { appliesTo = attribValue ; } } return appliesTo ; }
Looks at the manifest file extracting info and putting the info into the supplied asset
37,759
public static int bytesToInt ( byte [ ] bytes , int offset ) { return ( ( bytes [ offset + 3 ] & 0xFF ) << 0 ) + ( ( bytes [ offset + 2 ] & 0xFF ) << 8 ) + ( ( bytes [ offset + 1 ] & 0xFF ) << 16 ) + ( ( bytes [ offset + 0 ] & 0xFF ) << 24 ) ; }
A utility method to convert the int from the byte array to an int .
37,760
public static short bytesToShort ( byte [ ] bytes , int offset ) { short result = 0x0 ; for ( int i = offset ; i < offset + 2 ; ++ i ) { result = ( short ) ( ( result ) << 8 ) ; result |= ( bytes [ i ] & 0x00FF ) ; } return result ; }
A utility method to convert the short from the byte array to a short .
37,761
public static long bytesToLong ( byte [ ] bytes , int offset ) { long result = 0x0 ; for ( int i = offset ; i < offset + 8 ; ++ i ) { result = result << 8 ; result |= ( bytes [ i ] & 0x00000000000000FFl ) ; } return result ; }
A utility method to convert the long from the byte array to a long .
37,762
public static char bytesToChar ( byte [ ] bytes , int offset ) { char result = 0x0 ; for ( int i = offset ; i < offset + 2 ; ++ i ) { result = ( char ) ( ( result ) << 8 ) ; result |= ( bytes [ i ] & 0x00FF ) ; } return result ; }
A utility method to convert the char from the byte array to a char .
37,763
public static void intToBytes ( int value , byte [ ] bytes , int offset ) { bytes [ offset + 3 ] = ( byte ) ( value >>> 0 ) ; bytes [ offset + 2 ] = ( byte ) ( value >>> 8 ) ; bytes [ offset + 1 ] = ( byte ) ( value >>> 16 ) ; bytes [ offset + 0 ] = ( byte ) ( value >>> 24 ) ; }
A utility method to convert an int into bytes in an array .
37,764
public static void shortToBytes ( short value , byte [ ] bytes , int offset ) { for ( int i = offset + 1 ; i >= offset ; -- i ) { bytes [ i ] = ( byte ) value ; value = ( short ) ( ( value ) >> 8 ) ; } }
A utility method to convert a short into bytes in an array .
37,765
public static void longToBytes ( long value , byte [ ] bytes , int offset ) { for ( int i = offset + 7 ; i >= offset ; -- i ) { bytes [ i ] = ( byte ) value ; value = value >> 8 ; } }
A utility method to convert the long into bytes in an array .
37,766
public static long varIntBytesToLong ( byte [ ] bytes , int offset ) { int shift = 0 ; long result = 0 ; while ( shift < 64 ) { final byte b = bytes [ offset ++ ] ; result |= ( long ) ( b & 0x7F ) << shift ; if ( ( b & 0x80 ) == 0 ) { return result ; } shift += 7 ; } throw new IllegalStateException ( "Varint representation is invalid or exceeds 64-bit value" ) ; }
Reads a long from the byte array in the Varint format .
37,767
public static int varIntBytesToInt ( byte [ ] bytes , int offset ) { byte tmp = bytes [ offset ++ ] ; if ( tmp >= 0 ) { return tmp ; } int result = tmp & 0x7f ; if ( ( tmp = bytes [ offset ++ ] ) >= 0 ) { result |= tmp << 7 ; } else { result |= ( tmp & 0x7f ) << 7 ; if ( ( tmp = bytes [ offset ++ ] ) >= 0 ) { result |= tmp << 14 ; } else { result |= ( tmp & 0x7f ) << 14 ; if ( ( tmp = bytes [ offset ++ ] ) >= 0 ) { result |= tmp << 21 ; } else { result |= ( tmp & 0x7f ) << 21 ; result |= ( tmp = bytes [ offset ++ ] ) << 28 ; if ( tmp < 0 ) { for ( int i = 0 ; i < 5 ; i ++ ) { if ( bytes [ offset ++ ] >= 0 ) { return result ; } } throw new IllegalStateException ( "Varint representation is invalid or exceeds 32-bit value" ) ; } } } } return result ; }
Reads an int from the byte array in the Varint format .
37,768
public static int writeLongAsVarIntBytes ( long v , byte [ ] bytes , int offest ) { int pos = offest ; while ( true ) { if ( ( v & ~ 0x7FL ) == 0 ) { bytes [ pos ++ ] = ( ( byte ) v ) ; return pos ; } else { bytes [ pos ++ ] = ( byte ) ( ( v & 0x7F ) | 0x80 ) ; v >>>= 7 ; } } }
Writes a long to the byte array in the Varint format .
37,769
public static int writeIntAsVarIntBytes ( int intVal , byte [ ] bytes , int offset ) { int pos = offset ; int v = intVal ; if ( ( v & ~ 0x7F ) == 0 ) { bytes [ pos ++ ] = ( ( byte ) v ) ; return 1 + offset ; } while ( true ) { if ( ( v & ~ 0x7F ) == 0 ) { bytes [ pos ++ ] = ( ( byte ) v ) ; return pos ; } else { bytes [ pos ++ ] = ( byte ) ( ( v & 0x7F ) | 0x80 ) ; v >>>= 7 ; } } }
Writes an integer to the byte array in the Varint format .
37,770
public static String limitedBytesToString ( byte [ ] bytes ) { if ( bytes . length <= 1000 ) { return Arrays . toString ( bytes ) ; } else { byte [ ] firstBytes = new byte [ 1000 ] ; System . arraycopy ( bytes , 0 , firstBytes , 0 , 1000 ) ; return Arrays . toString ( firstBytes ) ; } }
If the byte array length is less than 1000 returns the result of calling Arrays . toString on the supplied byte array . Otherwise returns the result of calling Arrays . toString on a byte array containing the first 1000 bytes in the supplied byte array .
37,771
public static RESTHandlerJsonException createRESTHandlerJsonException ( Throwable e , JSONConverter converter , int status ) { try { if ( converter == null ) { converter = JSONConverter . getConverter ( ) ; } ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; converter . writeThrowable ( os , e ) ; String exceptionMessage = os . toString ( "UTF-8" ) ; return new RESTHandlerJsonException ( exceptionMessage , status , true ) ; } catch ( IOException innerException ) { return new RESTHandlerJsonException ( e . getMessage ( ) , status , true ) ; } finally { JSONConverter . returnConverter ( converter ) ; } }
This method will recycle the given converter .
37,772
public static synchronized void notifyStarted ( HttpEndpointImpl endpoint , String resolvedHostName , int port , boolean isHttps ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Notify endpoint started: " + endpoint , resolvedHostName , port , isHttps , defaultHost . get ( ) , alternateHostSelector ) ; } if ( alternateHostSelector . get ( ) == null ) { if ( defaultHost . get ( ) != null ) { defaultHost . get ( ) . listenerStarted ( endpoint , resolvedHostName , port , isHttps ) ; } } else { alternateHostSelector . get ( ) . alternateNotifyStarted ( endpoint , resolvedHostName , port , isHttps ) ; } }
Add an endpoint that has started listening and notify associated virtual hosts
37,773
public static synchronized void notifyStopped ( HttpEndpointImpl endpoint , String resolvedHostName , int port , boolean isHttps ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Notify endpoint stopped: " + endpoint , resolvedHostName , port , isHttps , defaultHost . get ( ) , alternateHostSelector ) ; } if ( alternateHostSelector . get ( ) == null ) { if ( defaultHost . get ( ) != null ) { defaultHost . get ( ) . listenerStopped ( endpoint , resolvedHostName , port , isHttps ) ; } } else { alternateHostSelector . get ( ) . alternateNotifyStopped ( endpoint , resolvedHostName , port , isHttps ) ; } }
Remove a port associated with an endpoint that has stopped listening and notify associated virtual hosts .
37,774
public void addWsByteBuffer ( WsByteBuffer buffer ) { if ( this . allWsByteBuffers == null ) { this . allWsByteBuffers = new Hashtable < WsByteBuffer , WsByteBuffer > ( ) ; } this . allWsByteBuffers . put ( buffer , buffer ) ; }
Add a related buffer to the stored list for this instance .
37,775
public void addOwner ( String owner ) { if ( this . owners == null ) { this . owners = new Hashtable < String , String > ( ) ; } this . owners . put ( owner , owner ) ; }
Add the following owner to the list for this buffer .
37,776
public String getInputUniqueUserId ( String inputVirtualRealm ) { String returnValue = getInputMapping ( inputVirtualRealm , Service . CONFIG_DO_UNIQUE_USER_ID_MAPPING , UNIQUE_USER_ID_DEFAULT ) ; return returnValue ; }
Get the input unique user ID mapping for the UserRegistry .
37,777
public String getOutputUniqueUserId ( String inputVirtualRealm ) { String returnValue = getOutputMapping ( inputVirtualRealm , Service . CONFIG_DO_UNIQUE_USER_ID_MAPPING , UNIQUE_USER_ID_DEFAULT ) ; return returnValue ; }
Get the output unique user ID mapping for the UserRegistry .
37,778
public String getInputUserSecurityName ( String inputVirtualRealm ) { String returnValue = getInputMapping ( inputVirtualRealm , Service . CONFIG_DO_USER_SECURITY_NAME_MAPPING , INPUT_USER_SECURITY_NAME_DEFAULT ) ; return returnValue ; }
Get the input user security name mapping for the UserRegistry .
37,779
public String getInputUserDisplayName ( String inputVirtualRealm ) { String returnValue = getInputMapping ( inputVirtualRealm , Service . CONFIG_DO_USER_DISPLAY_NAME_MAPPING , USER_DISPLAY_NAME_DEFAULT ) ; return returnValue ; }
Get the input user display name mapping for the UserRegistry .
37,780
public String getOutputUserDisplayName ( String inputVirtualRealm ) { String returnValue = getOutputMapping ( inputVirtualRealm , Service . CONFIG_DO_USER_DISPLAY_NAME_MAPPING , USER_DISPLAY_NAME_DEFAULT ) ; return returnValue ; }
Get the output user display name mapping for the UserRegistry .
37,781
public String getInputUniqueGroupId ( String inputVirtualRealm ) { String returnValue = getInputMapping ( inputVirtualRealm , Service . CONFIG_DO_UNIQUE_GROUP_ID_MAPPING , INPUT_UNIQUE_GROUP_ID_DEFAULT ) ; return returnValue ; }
Get the input unique group ID mapping for the UserRegistry .
37,782
public String getOutputUniqueGroupId ( String inputVirtualRealm ) { String returnValue = getOutputMapping ( inputVirtualRealm , Service . CONFIG_DO_UNIQUE_GROUP_ID_MAPPING , OUTPUT_UNIQUE_GROUP_ID_DEFAULT ) ; return returnValue ; }
Get the output unique group ID mapping for the UserRegistry .
37,783
public String getInputGroupSecurityName ( String inputVirtualRealm ) { String returnValue = getInputMapping ( inputVirtualRealm , Service . CONFIG_DO_GROUP_SECURITY_NAME_MAPPING , INPUT_GROUP_SECURITY_NAME_DEFAULT ) ; return returnValue ; }
Get the input group security name mapping for the UserRegistry .
37,784
public String getOutputGroupSecurityName ( String inputVirtualRealm ) { String returnValue = getOutputMapping ( inputVirtualRealm , Service . CONFIG_DO_GROUP_SECURITY_NAME_MAPPING , OUTPUT_GROUP_SECURITY_NAME_DEFAULT ) ; return returnValue ; }
Get the output group security name mapping for the UserRegistry .
37,785
public String getInputGroupDisplayName ( String inputVirtualRealm ) { String returnValue = getInputMapping ( inputVirtualRealm , Service . CONFIG_DO_GROUP_DISPLAY_NAME_MAPPING , GROUP_DISPLAY_NAME_DEFAULT ) ; return returnValue ; }
Get the input group display name mapping for the UserRegistry .
37,786
public String getOutputGroupDisplayName ( String inputVirtualRealm ) { String returnValue = getOutputMapping ( inputVirtualRealm , Service . CONFIG_DO_GROUP_DISPLAY_NAME_MAPPING , GROUP_DISPLAY_NAME_DEFAULT ) ; return returnValue ; }
Get the output group display name mapping for the UserRegistry .
37,787
@ FFDCIgnore ( Exception . class ) private String getInputMapping ( String inputVirtualRealm , String inputProperty , String inputDefaultProperty ) { String methodName = "getInputMapping" ; String returnValue = null ; RealmConfig realmConfig = mappingUtils . getCoreConfiguration ( ) . getRealmConfig ( inputVirtualRealm ) ; if ( realmConfig != null ) { try { returnValue = realmConfig . getURMapInputPropertyInRealm ( inputProperty ) ; if ( ( returnValue == null ) || ( returnValue . equals ( "" ) ) ) { returnValue = inputDefaultProperty ; } } catch ( Exception toCatch ) { returnValue = inputDefaultProperty ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " " + toCatch . getMessage ( ) , toCatch ) ; } } } else { returnValue = inputDefaultProperty ; } return returnValue ; }
Get the WIM input property that maps to the UserRegistry input property .
37,788
private static Object _convertOrCoerceValue ( FacesContext facesContext , UIComponent uiComponent , Object value , SelectItem selectItem , Converter converter ) { Object itemValue = selectItem . getValue ( ) ; if ( converter != null && itemValue instanceof String ) { itemValue = converter . getAsObject ( facesContext , uiComponent , ( String ) itemValue ) ; } else { try { if ( value instanceof java . lang . Enum ) { Class targetClass = value . getClass ( ) ; if ( targetClass != null && ! targetClass . isEnum ( ) ) { targetClass = targetClass . getSuperclass ( ) ; } itemValue = _ClassUtils . convertToTypeNoLogging ( facesContext , itemValue , targetClass ) ; } else { itemValue = _ClassUtils . convertToTypeNoLogging ( facesContext , itemValue , value . getClass ( ) ) ; } } catch ( IllegalArgumentException e ) { } catch ( Exception e ) { } } return itemValue ; }
If converter is available and selectItem . value is String uses getAsObject otherwise uses EL type coertion and return result .
37,789
public final static MessageType getMessageType ( Byte aValue ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Value = " + aValue ) ; return set [ aValue . intValue ( ) ] ; }
Returns the corresponding MessageType for a given Byte . This method should NOT be called by any code outside the MFP component . It is only public so that it can be accessed by sub - packages .
37,790
void balance ( int kFactor , NodeStack stack , GBSNode fpoint , int fpidx , int maxBal ) { GBSNode bparent = stack . node ( fpidx - 1 ) ; switch ( kFactor ) { case 2 : balance2 ( stack , bparent , fpoint , fpidx , maxBal ) ; break ; case 4 : balance4 ( stack , bparent , fpoint , fpidx , maxBal ) ; break ; case 6 : balance6 ( stack , bparent , fpoint , fpidx , maxBal ) ; break ; case 8 : balance8 ( stack , bparent , fpoint , fpidx , maxBal ) ; break ; case 12 : balance12 ( stack , bparent , fpoint , fpidx , maxBal ) ; break ; case 16 : balance16 ( stack , bparent , fpoint , fpidx , maxBal ) ; break ; case 24 : balance24 ( stack , bparent , fpoint , fpidx , maxBal ) ; break ; case 32 : balance32 ( stack , bparent , fpoint , fpidx , maxBal ) ; break ; default : String x = "Unknown K factor in fringe balance: " + kFactor ; error ( x ) ; break ; } }
Balance a fringe following the addition of its final node .
37,791
private void balance2 ( NodeStack stack , GBSNode bparent , GBSNode fpoint , int fpidx , int maxBal ) { GBSNode a = fpoint ; GBSNode b = a . rightChild ( ) ; if ( bparent . rightChild ( ) == a ) bparent . setRightChild ( b ) ; else bparent . setLeftChild ( b ) ; b . setLeftChild ( a ) ; a . clearRightChild ( ) ; if ( ( fpidx > 1 ) && ( stack . balancePointIndex ( ) > - 1 ) ) { GBSNode qpoint = b ; stack . setNode ( fpidx , qpoint ) ; GBSInsertHeight . singleInstance ( ) . balance ( stack , qpoint ) ; } }
Balance a fringe with a K factor of two .
37,792
private void balance4 ( NodeStack stack , GBSNode bparent , GBSNode fpoint , int fpidx , int maxBal ) { if ( maxBal == 3 ) { GBSNode a = fpoint ; GBSNode b = a . rightChild ( ) ; if ( bparent . rightChild ( ) == a ) bparent . setRightChild ( b ) ; else bparent . setLeftChild ( b ) ; b . setLeftChild ( a ) ; a . clearRightChild ( ) ; } else { if ( maxBal != 5 ) error ( "fringeBalance4: maxBal != 5, maxBal = " + maxBal ) ; GBSNode t0_top = stack . node ( fpidx - 2 ) ; GBSNode c = fpoint ; GBSNode d = c . rightChild ( ) ; GBSNode e = d . rightChild ( ) ; GBSNode f = e . rightChild ( ) ; d . setChildren ( bparent , f ) ; c . clearRightChild ( ) ; f . setLeftChild ( e ) ; e . clearRightChild ( ) ; if ( t0_top . rightChild ( ) == bparent ) t0_top . setRightChild ( d ) ; else t0_top . setLeftChild ( d ) ; if ( ( fpidx > 2 ) && ( stack . balancePointIndex ( ) > - 1 ) ) { GBSNode qpoint = d ; stack . setNode ( fpidx - 1 , qpoint ) ; GBSInsertHeight . singleInstance ( ) . balance ( stack , qpoint ) ; } } }
Balance a fringe with a K factor of four .
37,793
private void balance6 ( NodeStack stack , GBSNode bparent , GBSNode fpoint , int fpidx , int maxBal ) { if ( maxBal == 5 ) { GBSNode a = fpoint ; GBSNode b = a . rightChild ( ) ; GBSNode c = b . rightChild ( ) ; if ( bparent . rightChild ( ) == a ) bparent . setRightChild ( c ) ; else bparent . setLeftChild ( c ) ; c . setLeftChild ( b ) ; b . setChildren ( a , null ) ; a . clearRightChild ( ) ; } else { if ( maxBal != 8 ) error ( "fringeBalance6: maxBal != 8, maxBal = " + maxBal ) ; GBSNode t0_top = stack . node ( fpidx - 2 ) ; GBSNode c = bparent ; GBSNode d = fpoint ; GBSNode e = d . rightChild ( ) ; GBSNode f = e . rightChild ( ) ; GBSNode g = f . rightChild ( ) ; GBSNode h = g . rightChild ( ) ; GBSNode i = h . rightChild ( ) ; f . setChildren ( c , i ) ; i . setLeftChild ( h ) ; h . setChildren ( g , null ) ; g . clearRightChild ( ) ; e . clearRightChild ( ) ; if ( t0_top . rightChild ( ) == c ) t0_top . setRightChild ( f ) ; else t0_top . setLeftChild ( f ) ; if ( ( fpidx > 2 ) && ( stack . balancePointIndex ( ) > - 1 ) ) { GBSNode qpoint = f ; stack . setNode ( fpidx - 1 , qpoint ) ; GBSInsertHeight . singleInstance ( ) . balance ( stack , qpoint ) ; } } }
Balance a fringe with a K factor of six .
37,794
private void balance8 ( NodeStack stack , GBSNode bparent , GBSNode fpoint , int fpidx , int maxBal ) { if ( maxBal == 7 ) { GBSNode a = fpoint ; GBSNode b = a . rightChild ( ) ; GBSNode c = b . rightChild ( ) ; GBSNode d = c . rightChild ( ) ; GBSNode e = d . rightChild ( ) ; GBSNode f = e . rightChild ( ) ; d . setLeftChild ( b ) ; d . setRightChild ( f ) ; b . setLeftChild ( a ) ; a . clearRightChild ( ) ; c . clearRightChild ( ) ; f . setLeftChild ( e ) ; e . clearRightChild ( ) ; if ( bparent . rightChild ( ) == a ) bparent . setRightChild ( d ) ; else bparent . setLeftChild ( d ) ; } else { if ( maxBal != 9 ) error ( "fringeBalance8: maxBal != 9, maxBal = " + maxBal ) ; GBSNode t0_top = stack . node ( fpidx - 3 ) ; GBSNode d = stack . node ( fpidx - 2 ) ; GBSNode g = fpoint ; GBSNode h = g . rightChild ( ) ; GBSNode i = h . rightChild ( ) ; GBSNode j = i . rightChild ( ) ; GBSNode k = j . rightChild ( ) ; GBSNode l = k . rightChild ( ) ; GBSNode m = l . rightChild ( ) ; GBSNode n = m . rightChild ( ) ; h . setLeftChild ( d ) ; h . setRightChild ( l ) ; l . setLeftChild ( j ) ; l . setRightChild ( n ) ; j . setLeftChild ( i ) ; i . clearRightChild ( ) ; k . clearRightChild ( ) ; n . setLeftChild ( m ) ; m . clearRightChild ( ) ; g . clearRightChild ( ) ; if ( t0_top . rightChild ( ) == d ) t0_top . setRightChild ( h ) ; else t0_top . setLeftChild ( h ) ; if ( ( fpidx > 3 ) && ( stack . balancePointIndex ( ) > - 1 ) ) { GBSNode qpoint = h ; stack . setNode ( fpidx - 2 , qpoint ) ; GBSInsertHeight . singleInstance ( ) . balance ( stack , qpoint ) ; } } }
Balance a fringe with a K factor of eight .
37,795
@ Reference ( name = BASE_INSTANCE , service = ContextService . class , cardinality = ReferenceCardinality . OPTIONAL , policy = ReferencePolicy . DYNAMIC , policyOption = ReferencePolicyOption . GREEDY , target = "(id=unbound)" ) protected void setBaseInstance ( ServiceReference < ContextService > ref ) { lock . writeLock ( ) . lock ( ) ; try { threadContextConfigurations = null ; } finally { lock . writeLock ( ) . unlock ( ) ; } }
Declarative Services method for setting the service reference to the base contextService instance .
37,796
@ Reference ( name = THREAD_CONTEXT_MANAGER , service = WSContextService . class , cardinality = ReferenceCardinality . MANDATORY , policy = ReferencePolicy . STATIC , target = "(component.name=com.ibm.ws.context.manager)" ) protected void setThreadContextManager ( WSContextService svc ) { threadContextMgr = ( ThreadContextManager ) svc ; }
Declarative Services method for setting the thread context manager .
37,797
protected void unsetBaseInstance ( ServiceReference < ContextService > ref ) { lock . writeLock ( ) . lock ( ) ; try { threadContextConfigurations = null ; } finally { lock . writeLock ( ) . unlock ( ) ; } }
Declarative Services method for unsetting the service reference to the base contextService instance .
37,798
public synchronized void complete ( ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINEST ) ) { logger . entering ( CLASS_NAME , "complete" , this ) ; } if ( ! lockHeldByDifferentThread ( ) ) { if ( ! completePending ) { if ( com . ibm . ws . webcontainer . osgi . WebContainer . getServletContainerSpecLevel ( ) > 31 ) { WebContainerRequestState reqState = WebContainerRequestState . getInstance ( true ) ; reqState . setAttribute ( "webcontainer.resetAsyncStartedOnExit" , "true" ) ; } else { iExtendedRequest . setAsyncStarted ( false ) ; } createNewAsyncServletReeentrantLock ( ) ; cancelAsyncTimer ( ) ; completeRunnable = new CompleteRunnable ( iExtendedRequest , this ) ; completePending = true ; if ( ! dispatching ) { executeNextRunnable ( ) ; } } } else { if ( WCCustomProperties . THROW_EXCEPTION_WHEN_UNABLE_TO_COMPLETE_OR_DISPATCH ) { throw new IllegalStateException ( nls . getString ( "AsyncContext.lock.already.held" , "Unable to obtain the lock. Error processing has already been invoked by another thread." ) ) ; } } dispatchURI = null ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINEST ) ) { logger . exiting ( CLASS_NAME , "complete" , this ) ; } }
we re okay to sync on the scheduling of the complete
37,799
public synchronized void dispatch ( ServletContext context , String path ) throws IllegalStateException { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINEST ) ) { logger . entering ( CLASS_NAME , "dispatch(ctx,path)" , new Object [ ] { this , context , path } ) ; } if ( ! lockHeldByDifferentThread ( ) ) { if ( completePending ) { throw new IllegalStateException ( nls . getString ( "called.dispatch.after.complete" ) ) ; } else if ( ! dispatchAllowed ) { throw new IllegalStateException ( nls . getString ( "trying.to.call.dispatch.twice.for.the.same.async.operation" ) ) ; } createNewAsyncServletReeentrantLock ( ) ; cancelAsyncTimer ( ) ; WebAppRequestDispatcher requestDispatcher = ( WebAppRequestDispatcher ) context . getRequestDispatcher ( path ) ; dispatchRunnable = new DispatchRunnable ( requestDispatcher , this ) ; dispatchPending = true ; dispatchAllowed = false ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINEST ) ) { logger . logp ( Level . FINEST , CLASS_NAME , "dispatch(ctx,path)" , "dispatching + dispatching ) ; } if ( ! dispatching ) { executeNextRunnable ( ) ; } } else { if ( WCCustomProperties . THROW_EXCEPTION_WHEN_UNABLE_TO_COMPLETE_OR_DISPATCH ) { throw new IllegalStateException ( nls . getString ( "AsyncContext.lock.already.held" , "Unable to obtain the lock. Error processing has already been invoked by another thread." ) ) ; } } dispatchURI = null ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINEST ) ) { logger . exiting ( CLASS_NAME , "dispatch(ctx,path)" , this ) ; } }
we re okay to sync on the scheduling of the dispatch