idx
int64 0
41.2k
| question
stringlengths 83
4.15k
| target
stringlengths 5
715
|
|---|---|---|
36,700
|
public String getLogProviderDefinition ( BootstrapConfig bootProps ) { String logProvider = bootProps . get ( BOOTPROP_LOG_PROVIDER ) ; if ( logProvider == null ) logProvider = defaults . getProperty ( MANIFEST_LOG_PROVIDER ) ; if ( logProvider != null ) bootProps . put ( BOOTPROP_LOG_PROVIDER , logProvider ) ; return logProvider ; }
|
Find and return the name of the log provider . Look in bootstrap properties first if not explicitly defined there get the default from the manifest .
|
36,701
|
public String getOSExtensionDefinition ( BootstrapConfig bootProps ) { String osExtension = bootProps . get ( BOOTPROP_OS_EXTENSIONS ) ; if ( osExtension == null ) { String normalizedName = getNormalizedOperatingSystemName ( bootProps . get ( "os.name" ) ) ; osExtension = defaults . getProperty ( MANIFEST_OS_EXTENSION + normalizedName ) ; } if ( osExtension != null ) bootProps . put ( BOOTPROP_OS_EXTENSIONS , osExtension ) ; return osExtension ; }
|
Find and return the name of the os extension . Look in bootstrap properties first if not explicitly defined there get the default from the manifest .
|
36,702
|
private TypeContainer getProperty ( String propName ) { TypeContainer container = cache . get ( propName ) ; if ( container == null ) { container = new TypeContainer ( propName , config , version ) ; TypeContainer existing = cache . putIfAbsent ( propName , container ) ; if ( existing != null ) { return existing ; } } return container ; }
|
Gets the cached property container or make a new one cache it and return it
|
36,703
|
private void publishStartedEvent ( ) { BatchEventsPublisher publisher = getBatchEventsPublisher ( ) ; if ( publisher != null ) { publisher . publishSplitFlowEvent ( getSplitName ( ) , getFlowName ( ) , getTopLevelInstanceId ( ) , getTopLevelExecutionId ( ) , BatchEventsPublisher . TOPIC_EXECUTION_SPLIT_FLOW_STARTED , correlationId ) ; } }
|
Publish started event
|
36,704
|
private void publishEndedEvent ( ) { BatchEventsPublisher publisher = getBatchEventsPublisher ( ) ; if ( publisher != null ) { publisher . publishSplitFlowEvent ( getSplitName ( ) , getFlowName ( ) , getTopLevelInstanceId ( ) , getTopLevelExecutionId ( ) , BatchEventsPublisher . TOPIC_EXECUTION_SPLIT_FLOW_ENDED , correlationId ) ; } }
|
Publish ended event
|
36,705
|
public void setHeaders ( Map < String , String > map ) { headers = new MetadataMap < String , String > ( ) ; for ( Map . Entry < String , String > entry : map . entrySet ( ) ) { String [ ] values = entry . getValue ( ) . split ( "," ) ; for ( String v : values ) { if ( v . length ( ) != 0 ) { headers . add ( entry . getKey ( ) , v ) ; } } } }
|
Sets the headers new proxy or WebClient instances will be initialized with .
|
36,706
|
public WebClient createWebClient ( ) { String serviceAddress = getAddress ( ) ; int queryIndex = serviceAddress != null ? serviceAddress . lastIndexOf ( '?' ) : - 1 ; if ( queryIndex != - 1 ) { serviceAddress = serviceAddress . substring ( 0 , queryIndex ) ; } Service service = new JAXRSServiceImpl ( serviceAddress , getServiceName ( ) ) ; getServiceFactory ( ) . setService ( service ) ; try { Endpoint ep = createEndpoint ( ) ; this . getServiceFactory ( ) . sendEvent ( FactoryBeanListener . Event . PRE_CLIENT_CREATE , ep ) ; ClientState actualState = getActualState ( ) ; WebClient client = actualState == null ? new WebClient ( getAddress ( ) ) : new WebClient ( actualState ) ; initClient ( client , ep , actualState == null ) ; notifyLifecycleManager ( client ) ; this . getServiceFactory ( ) . sendEvent ( FactoryBeanListener . Event . CLIENT_CREATED , client , ep ) ; return client ; } catch ( Exception ex ) { LOG . severe ( ex . getClass ( ) . getName ( ) + " : " + ex . getLocalizedMessage ( ) ) ; throw new RuntimeException ( ex ) ; } }
|
Creates a WebClient instance
|
36,707
|
public < T > T create ( Class < T > cls , Object ... varValues ) { return cls . cast ( createWithValues ( varValues ) ) ; }
|
Creates a proxy
|
36,708
|
public static final Object deserialize ( byte [ ] bytes ) throws Exception { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "deserialize" ) ; Object o ; try { ByteArrayInputStream bis = new ByteArrayInputStream ( bytes ) ; ObjectInputStream oin = new ObjectInputStream ( bis ) ; o = oin . readObject ( ) ; oin . close ( ) ; } catch ( IOException e ) { FFDCFilter . processException ( e , ConnectorService . class . getName ( ) , "151" ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "deserialize" , new Object [ ] { toString ( bytes ) , e } ) ; throw e ; } if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "deserialize" , o == null ? null : o . getClass ( ) ) ; return o ; }
|
Deserialize from an array of bytes .
|
36,709
|
public static final String getMessage ( String key , Object ... args ) { return NLS . getFormattedMessage ( key , args , key ) ; }
|
Get a translated message from J2CAMessages file .
|
36,710
|
public static final void logMessage ( Level level , String key , Object ... args ) { if ( WsLevel . AUDIT . equals ( level ) ) Tr . audit ( tc , key , args ) ; else if ( WsLevel . ERROR . equals ( level ) ) Tr . error ( tc , key , args ) ; else if ( Level . INFO . equals ( level ) ) Tr . info ( tc , key , args ) ; else if ( Level . WARNING . equals ( level ) ) Tr . warning ( tc , key , args ) ; else throw new UnsupportedOperationException ( level . toString ( ) ) ; }
|
Logs a message from the J2CAMessages file .
|
36,711
|
public static String getSessionID ( HttpServletRequest req ) { String sessionID = null ; final HttpServletRequest f_req = req ; try { sessionID = AccessController . doPrivileged ( new PrivilegedExceptionAction < String > ( ) { public String run ( ) throws Exception { HttpSession session = f_req . getSession ( ) ; if ( session != null ) { return session . getId ( ) ; } else { return null ; } } } ) ; } catch ( PrivilegedActionException e ) { if ( ( e . getException ( ) ) instanceof com . ibm . websphere . servlet . session . UnauthorizedSessionRequestException ) { if ( ! req . isRequestedSessionIdFromCookie ( ) ) { sessionID = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { public String run ( ) { return f_req . getSession ( ) . getId ( ) ; } } ) ; } else { sessionID = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { public String run ( ) { return f_req . getRequestedSessionId ( ) ; } } ) ; } } } catch ( com . ibm . websphere . servlet . session . UnauthorizedSessionRequestException e ) { try { if ( ! req . isRequestedSessionIdFromCookie ( ) ) { sessionID = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { public String run ( ) { return f_req . getSession ( ) . getId ( ) ; } } ) ; } else { sessionID = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { public String run ( ) { return f_req . getRequestedSessionId ( ) ; } } ) ; } } catch ( java . lang . NullPointerException ee ) { sessionID = "UnauthorizedSessionRequest" ; } catch ( com . ibm . websphere . servlet . session . UnauthorizedSessionRequestException ue ) { sessionID = "UnauthorizedSessionRequest" ; } } return sessionID ; }
|
Return the session id if the request has an HttpSession otherwise return null .
|
36,712
|
public static String getRequestScheme ( HttpServletRequest req ) { String scheme ; if ( req . getScheme ( ) != null ) scheme = req . getScheme ( ) . toUpperCase ( ) ; else scheme = AuditEvent . REASON_TYPE_HTTP ; return scheme ; }
|
Get the scheme from the request - generally HTTP or HTTPS
|
36,713
|
public static String getRequestMethod ( HttpServletRequest req ) { String method ; if ( req . getMethod ( ) != null ) method = req . getMethod ( ) . toUpperCase ( ) ; else method = AuditEvent . TARGET_METHOD_GET ; return method ; }
|
Get the method from the request - generally GET or POST
|
36,714
|
public Object get ( ) { Object oObject = null ; synchronized ( this ) { if ( lastEntry > - 1 ) { oObject = free [ lastEntry ] ; free [ lastEntry ] = null ; if ( lastEntry == firstEntry ) { lastEntry = - 1 ; firstEntry = - 1 ; } else if ( lastEntry > 0 ) { lastEntry = lastEntry - 1 ; } else { lastEntry = poolSize - 1 ; } } } if ( oObject == null && factory != null ) { oObject = factory . create ( ) ; } return oObject ; }
|
Gets an Object from the pool and returns it . If there are currently no entries in the pool then a new object will be created .
|
36,715
|
public Object put ( Object object ) { Object returnVal = null ; long currentTime = CHFWBundle . getApproxTime ( ) ; synchronized ( this ) { lastEntry ++ ; if ( lastEntry == poolSize ) { lastEntry = 0 ; } returnVal = free [ lastEntry ] ; free [ lastEntry ] = object ; timeFreed [ lastEntry ] = currentTime ; if ( lastEntry == firstEntry ) { firstEntry ++ ; if ( firstEntry == poolSize ) { firstEntry = 0 ; } } if ( firstEntry == - 1 ) { firstEntry = lastEntry ; } if ( returnVal != null && destroyer != null ) { destroyer . destroy ( returnVal ) ; } if ( cleanUpOld ) { while ( firstEntry != lastEntry ) { if ( currentTime > ( timeFreed [ firstEntry ] + 60000L ) ) { if ( destroyer != null && free [ firstEntry ] != null ) { destroyer . destroy ( free [ firstEntry ] ) ; } free [ firstEntry ] = null ; firstEntry ++ ; if ( firstEntry == poolSize ) { firstEntry = 0 ; } } else break ; } } } return returnVal ; }
|
Puts an Object into the free pool . If the free pool is full then this object will overlay the oldest object in the pool .
|
36,716
|
protected void putBatch ( Object [ ] objectArray ) { int index = 0 ; synchronized ( this ) { while ( index < objectArray . length && objectArray [ index ] != null ) { put ( objectArray [ index ] ) ; index ++ ; } } return ; }
|
Puts a set of Objects into the free pool . If the free pool is full then this object will overlay the oldest object in the pool .
|
36,717
|
public JsJmsMessage createJmsMessage ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createJmsMessage" ) ; JsJmsMessage msg = null ; try { msg = new JsJmsMessageImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createJmsMessage" ) ; return msg ; }
|
Create a new empty null - bodied JMS Message . To be called by the API component .
|
36,718
|
public JsJmsBytesMessage createJmsBytesMessage ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createJmsBytesMessage" ) ; JsJmsBytesMessage msg = null ; try { msg = new JsJmsBytesMessageImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createJmsBytesMessage" ) ; return msg ; }
|
Create a new empty JMS BytesMessage . To be called by the API component .
|
36,719
|
public JsJmsMapMessage createJmsMapMessage ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createJmsMapMessage" ) ; JsJmsMapMessage msg = null ; try { msg = new JsJmsMapMessageImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createJmsMapMessage" ) ; return msg ; }
|
Create a new empty JMS MapMessage . To be called by the API component .
|
36,720
|
public JsJmsObjectMessage createJmsObjectMessage ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createJmsObjectMessage" ) ; JsJmsObjectMessage msg = null ; try { msg = new JsJmsObjectMessageImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createJmsObjectMessage" ) ; return msg ; }
|
Create a new empty JMS ObjectMessage . To be called by the API component .
|
36,721
|
public JsJmsStreamMessage createJmsStreamMessage ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createJmsStreamMessage" ) ; JsJmsStreamMessage msg = null ; try { msg = new JsJmsStreamMessageImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createJmsStreamMessage" ) ; return msg ; }
|
Create a new empty JMS StreamMessage . To be called by the API component .
|
36,722
|
public JsJmsTextMessage createJmsTextMessage ( ) throws MessageCreateFailedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createJmsTextMessage" ) ; JsJmsTextMessage msg = null ; try { msg = new JsJmsTextMessageImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; } catch ( MessageDecodeFailedException e ) { throw new MessageCreateFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createJmsTextMessage" ) ; return msg ; }
|
Create a new empty JMS TextMessage . To be called by the API component .
|
36,723
|
private void saveDecryptedPositions ( ) { for ( int i = 0 ; i < decryptedNetPosInfo . length ; i ++ ) { decryptedNetPosInfo [ i ] = 0 ; } if ( null != getBuffers ( ) ) { WsByteBuffer [ ] buffers = getBuffers ( ) ; if ( buffers . length > decryptedNetPosInfo . length ) { decryptedNetPosInfo = new int [ buffers . length ] ; } for ( int i = 0 ; i < buffers . length && null != buffers [ i ] ; i ++ ) { decryptedNetPosInfo [ i ] = buffers [ i ] . position ( ) ; } } }
|
Save the starting positions of the output buffers so that we can properly calculate the amount of data being returned by the read .
|
36,724
|
public VirtualConnection read ( long numBytes , TCPReadCompletedCallback userCallback , boolean forceQueue , int timeout ) { return read ( numBytes , userCallback , forceQueue , timeout , false ) ; }
|
Note a separate thread is not spawned to handle the decryption . The asynchronous behavior of this call will take place when the device side channel makes a nonblocking IO call and the request is potentially moved to a separate thread .
|
36,725
|
private void handleAsyncComplete ( boolean forceQueue , TCPReadCompletedCallback inCallback ) { boolean fireHere = true ; if ( forceQueue ) { queuedWork . setCompleteParameters ( getConnLink ( ) . getVirtualConnection ( ) , this , inCallback ) ; EventEngine events = SSLChannelProvider . getEventService ( ) ; if ( null == events ) { Exception e = new Exception ( "missing event service" ) ; FFDCFilter . processException ( e , getClass ( ) . getName ( ) , "471" , this ) ; } else { Event event = events . createEvent ( SSLEventHandler . TOPIC_QUEUED_WORK ) ; event . setProperty ( SSLEventHandler . KEY_RUNNABLE , this . queuedWork ) ; events . postEvent ( event ) ; fireHere = false ; } } if ( fireHere ) { inCallback . complete ( getConnLink ( ) . getVirtualConnection ( ) , this ) ; } }
|
This method handles calling the complete method of the callback as required by an async read . Appropriate action is taken based on the setting of the forceQueue parameter . If it is true the complete callback is called on a separate thread . Otherwise it is called right here .
|
36,726
|
private void handleAsyncError ( boolean forceQueue , IOException exception , TCPReadCompletedCallback inCallback ) { boolean fireHere = true ; if ( forceQueue ) { queuedWork . setErrorParameters ( getConnLink ( ) . getVirtualConnection ( ) , this , inCallback , exception ) ; EventEngine events = SSLChannelProvider . getEventService ( ) ; if ( null == events ) { Exception e = new Exception ( "missing event service" ) ; FFDCFilter . processException ( e , getClass ( ) . getName ( ) , "503" , this ) ; } else { Event event = events . createEvent ( SSLEventHandler . TOPIC_QUEUED_WORK ) ; event . setProperty ( SSLEventHandler . KEY_RUNNABLE , this . queuedWork ) ; events . postEvent ( event ) ; fireHere = false ; } } if ( fireHere ) { inCallback . error ( getConnLink ( ) . getVirtualConnection ( ) , this , exception ) ; } }
|
This method handles errors when they occur during the code path of an async read . It takes appropriate action based on the setting of the forceQueue parameter . If it is true the error callback is called on a separate thread . Otherwise it is called right here .
|
36,727
|
public long readUnconsumedDecData ( ) { long totalBytesRead = 0L ; if ( unconsumedDecData != null ) { if ( getBuffer ( ) == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Caller needs buffer, unconsumed data: " + SSLUtils . getBufferTraceInfo ( unconsumedDecData ) ) ; } totalBytesRead = SSLUtils . lengthOf ( unconsumedDecData , 0 ) ; cleanupDecBuffers ( ) ; callerRequiredAllocation = true ; decryptedNetBuffers = unconsumedDecData ; unconsumedDecData = null ; if ( ( decryptedNetLimitInfo == null ) || ( decryptedNetLimitInfo . length != decryptedNetBuffers . length ) ) { decryptedNetLimitInfo = new int [ decryptedNetBuffers . length ] ; } SSLUtils . getBufferLimits ( decryptedNetBuffers , decryptedNetLimitInfo ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Caller provided buffers, unconsumed data: " + SSLUtils . getBufferTraceInfo ( unconsumedDecData ) ) ; } cleanupDecBuffers ( ) ; decryptedNetBuffers = unconsumedDecData ; totalBytesRead = copyDataToCallerBuffers ( ) ; decryptedNetBuffers = null ; } } return totalBytesRead ; }
|
This method is called when a read is requested . It checks to see if any data is left over from the previous read but there wasn t space in the buffers to store the result .
|
36,728
|
protected void getNetworkBuffer ( long requestedSize ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getNetworkBuffer: size=" + requestedSize ) ; } this . netBufferMark = 0 ; int allocationSize = getConnLink ( ) . getPacketBufferSize ( ) ; if ( allocationSize < requestedSize ) { allocationSize = ( int ) requestedSize ; } if ( null == this . netBuffer ) { this . netBuffer = SSLUtils . allocateByteBuffer ( allocationSize , true ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Found existing netbuffer, " + SSLUtils . getBufferTraceInfo ( netBuffer ) ) ; } int cap = netBuffer . capacity ( ) ; int pos = netBuffer . position ( ) ; int lim = netBuffer . limit ( ) ; if ( pos == lim ) { if ( cap >= allocationSize ) { this . netBuffer . clear ( ) ; } else { this . netBuffer . release ( ) ; this . netBuffer = SSLUtils . allocateByteBuffer ( allocationSize , true ) ; } } else { if ( ( cap - pos ) < allocationSize ) { WsByteBuffer buffer = SSLUtils . allocateByteBuffer ( allocationSize , true ) ; SSLUtils . copyBuffer ( this . netBuffer , buffer , lim - pos ) ; this . netBuffer . release ( ) ; this . netBuffer = buffer ; } else { this . netBufferMark = pos ; this . netBuffer . position ( lim ) ; this . netBuffer . limit ( cap ) ; } } } deviceReadContext . setBuffer ( this . netBuffer ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "netBuffer: " + SSLUtils . getBufferTraceInfo ( this . netBuffer ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "getNetworkBuffer" ) ; } }
|
Get the buffers that the device channel should read into . These buffers get reused over the course of multiple reads . The size of the buffers are determined by either the allocation size specified by the application channel or if that wasn t set the max packet buffer size specified in the SSL engine .
|
36,729
|
private void cleanupDecBuffers ( ) { if ( null != this . decryptedNetBuffers && ( callerRequiredAllocation || decryptedNetBufferReleaseRequired ) ) { WsByteBufferUtils . releaseBufferArray ( this . decryptedNetBuffers ) ; this . decryptedNetBuffers = null ; } }
|
Utility method to handle releasing the decrypted network buffers that we may or may not own at this point .
|
36,730
|
public void close ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "close, vc=" + getVCHash ( ) ) ; } synchronized ( closeSync ) { if ( closeCalled ) { return ; } closeCalled = true ; if ( null != this . netBuffer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Releasing netBuffer during close " + SSLUtils . getBufferTraceInfo ( netBuffer ) ) ; } this . netBuffer . release ( ) ; this . netBuffer = null ; } cleanupDecBuffers ( ) ; if ( unconsumedDecData != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Releasing unconsumed decrypted buffers, " + SSLUtils . getBufferTraceInfo ( unconsumedDecData ) ) ; } WsByteBufferUtils . releaseBufferArray ( unconsumedDecData ) ; unconsumedDecData = null ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "close" ) ; } }
|
Release the potential buffer that were created
|
36,731
|
private SSLEngineResult doHandshake ( boolean async ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "doHandshake" ) ; } SSLEngineResult sslResult ; int appSize = getConnLink ( ) . getAppBufferSize ( ) ; int packetSize = getConnLink ( ) . getPacketBufferSize ( ) ; WsByteBuffer localNetBuffer = SSLUtils . allocateByteBuffer ( packetSize , true ) ; WsByteBuffer decryptedNetBuffer = SSLUtils . allocateByteBuffer ( appSize , false ) ; WsByteBuffer encryptedAppBuffer = SSLUtils . allocateByteBuffer ( packetSize , true ) ; MyHandshakeCompletedCallback handshakeCallback = null ; if ( async ) { handshakeCallback = new MyHandshakeCompletedCallback ( this , callback , localNetBuffer , decryptedNetBuffer , encryptedAppBuffer ) ; } try { sslResult = SSLUtils . handleHandshake ( getConnLink ( ) , localNetBuffer , decryptedNetBuffer , encryptedAppBuffer , null , handshakeCallback , false ) ; } catch ( IOException e ) { localNetBuffer . release ( ) ; localNetBuffer = null ; decryptedNetBuffer . release ( ) ; decryptedNetBuffer = null ; encryptedAppBuffer . release ( ) ; encryptedAppBuffer = null ; throw e ; } if ( sslResult != null ) { localNetBuffer . release ( ) ; localNetBuffer = null ; decryptedNetBuffer . release ( ) ; decryptedNetBuffer = null ; encryptedAppBuffer . release ( ) ; encryptedAppBuffer = null ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "doHandshake" ) ; } return sslResult ; }
|
When data is read there is always the change the a renegotiation will take place . If so this method will be called . Note it is used by both the sync and async writes .
|
36,732
|
protected ContextualStorage getContextualStorage ( boolean createIfNotExist , String clientWindowFlowId ) { if ( clientWindowFlowId == null ) { throw new ContextNotActiveException ( "FlowScopedContextImpl: no current active flow" ) ; } if ( createIfNotExist ) { return getFlowScopeBeanHolder ( ) . getContextualStorage ( beanManager , clientWindowFlowId ) ; } else { return getFlowScopeBeanHolder ( ) . getContextualStorageNoCreate ( beanManager , clientWindowFlowId ) ; } }
|
An implementation has to return the underlying storage which contains the items held in the Context .
|
36,733
|
protected void proxyReadHandshake ( ) { connLink . getReadInterface ( ) . setJITAllocateSize ( 1024 ) ; if ( connLink . isAsyncConnect ( ) ) { this . proxyReadCB = new ProxyReadCallback ( ) ; readProxyResponse ( connLink . getVirtualConnection ( ) ) ; } else { int rc = STATUS_NOT_DONE ; while ( rc == STATUS_NOT_DONE ) { readProxyResponse ( connLink . getVirtualConnection ( ) ) ; rc = checkResponse ( connLink . getReadInterface ( ) ) ; } if ( rc == STATUS_ERROR ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "could not complete proxy handshake, read request failed" ) ; } releaseProxyReadBuffer ( ) ; if ( connLink . isSyncError ( ) == false ) { connLink . connectFailed ( new IOException ( "Invalid Proxy Server Response " ) ) ; } } } }
|
Complete the proxy connect handshake by reading for the response and validating any data .
|
36,734
|
protected int checkResponse ( TCPReadRequestContext rsc ) { WsByteBuffer [ ] buffers = rsc . getBuffers ( ) ; if ( null == buffers ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Could not complete proxy handshake, null buffers" ) ; } return STATUS_ERROR ; } int status = validateProxyResponse ( buffers ) ; if ( STATUS_DONE == status ) { releaseProxyReadBuffer ( ) ; } return status ; }
|
Check for a proxy handshake response .
|
36,735
|
protected void releaseProxyWriteBuffer ( ) { WsByteBuffer buffer = connLink . getWriteInterface ( ) . getBuffer ( ) ; if ( null != buffer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Releasing proxy write buffer: " + buffer ) ; } buffer . release ( ) ; connLink . getWriteInterface ( ) . setBuffer ( null ) ; } }
|
Release the proxy connect write buffer .
|
36,736
|
protected void releaseProxyReadBuffer ( ) { WsByteBuffer buffer = connLink . getReadInterface ( ) . getBuffer ( ) ; if ( null != buffer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Releasing proxy read buffer: " + buffer ) ; } buffer . release ( ) ; connLink . getReadInterface ( ) . setBuffer ( null ) ; } }
|
Release the proxy connect read buffer .
|
36,737
|
protected boolean containsHTTP200 ( byte [ ] data ) { boolean rc = true ; if ( data . length < 12 || data [ 0 ] != 'H' || data [ 1 ] != 'T' || data [ 2 ] != 'T' || data [ 3 ] != 'P' || data [ 9 ] != '2' || data [ 10 ] != '0' || data [ 11 ] != '0' ) { rc = false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "containsHTTP200: " + rc ) ; } return rc ; }
|
Checks if the byte array contains HTTP 200 in a byte array .
|
36,738
|
protected void readProxyResponse ( VirtualConnection inVC ) { int size = 1 ; if ( ! this . isProxyResponseValid ) { size = 12 ; } if ( connLink . isAsyncConnect ( ) ) { VirtualConnection vcRC = connLink . getReadInterface ( ) . read ( size , this . proxyReadCB , false , TCPRequestContext . USE_CHANNEL_TIMEOUT ) ; if ( null != vcRC ) { this . proxyReadCB . complete ( vcRC , connLink . getReadInterface ( ) ) ; } } else { try { connLink . getReadInterface ( ) . read ( size , TCPRequestContext . USE_CHANNEL_TIMEOUT ) ; } catch ( IOException x ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "could not complete proxy handshake, read request failed" ) ; } releaseProxyReadBuffer ( ) ; connLink . connectFailed ( x ) ; } } }
|
Start a read for the response from the target proxy this is either the first read or possibly secondary ones if necessary .
|
36,739
|
public synchronized void setDefaultDestLimits ( ) throws MessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setDefaultDestLimits" ) ; long destHighMsgs = mp . getHighMessageThreshold ( ) ; setDestLimits ( destHighMsgs , ( destHighMsgs * 8 ) / 10 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setDefaultDestLimits" ) ; }
|
Set the default limits for this itemstream
|
36,740
|
public long getDestHighMsgs ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getDestHighMsgs" ) ; SibTr . exit ( tc , "getDestHighMsgs" , Long . valueOf ( _destHighMsgs ) ) ; } return _destHighMsgs ; }
|
Gets the destination high messages limit currently being used by this localization .
|
36,741
|
public long getDestLowMsgs ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getDestLowMsgs" ) ; SibTr . exit ( tc , "getDestLowMsgs" , Long . valueOf ( _destLowMsgs ) ) ; } return _destLowMsgs ; }
|
Gets the destination low messages limit currently being used by this localization .
|
36,742
|
public void fireDepthThresholdReachedEvent ( ControlAdapter cAdapter , boolean reachedHigh , long numMsgs , long msgLimit ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "fireDepthThresholdReachedEvent" , new Object [ ] { cAdapter , new Boolean ( reachedHigh ) , new Long ( numMsgs ) } ) ; String destinationName = destinationHandler . getName ( ) ; String meName = mp . getMessagingEngineName ( ) ; if ( mp . getCustomProperties ( ) . getOutputDestinationThresholdEventsToLog ( ) ) { if ( reachedHigh ) SibTr . info ( tc , "NOTIFY_DEPTH_THRESHOLD_REACHED_CWSIP0553" , new Object [ ] { destinationName , meName , msgLimit } ) ; else SibTr . info ( tc , "NOTIFY_DEPTH_THRESHOLD_REACHED_CWSIP0554" , new Object [ ] { destinationName , meName , msgLimit } ) ; } if ( _isEventNotificationEnabled ) { if ( cAdapter != null ) { String message = null ; if ( reachedHigh ) message = nls . getFormattedMessage ( "NOTIFY_DEPTH_THRESHOLD_REACHED_CWSIP0553" , new Object [ ] { destinationName , meName , msgLimit } , null ) ; else message = nls . getFormattedMessage ( "NOTIFY_DEPTH_THRESHOLD_REACHED_CWSIP0554" , new Object [ ] { destinationName , meName , msgLimit } , null ) ; Properties props = new Properties ( ) ; props . put ( SibNotificationConstants . KEY_DESTINATION_NAME , destinationName ) ; props . put ( SibNotificationConstants . KEY_DESTINATION_UUID , destinationHandler . getUuid ( ) . toString ( ) ) ; if ( reachedHigh ) props . put ( SibNotificationConstants . KEY_DEPTH_THRESHOLD_REACHED , SibNotificationConstants . DEPTH_THRESHOLD_REACHED_HIGH ) ; else props . put ( SibNotificationConstants . KEY_DEPTH_THRESHOLD_REACHED , SibNotificationConstants . DEPTH_THRESHOLD_REACHED_LOW ) ; props . put ( SibNotificationConstants . KEY_MESSAGES , String . valueOf ( numMsgs ) ) ; MPRuntimeEvent MPevent = new MPRuntimeEvent ( SibNotificationConstants . TYPE_SIB_MESSAGEPOINT_DEPTH_THRESHOLD_REACHED , message , props ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "fireDepthThresholdReachedEvent" , "Drive runtimeEventOccurred against Control adapter: " + cAdapter ) ; cAdapter . runtimeEventOccurred ( MPevent ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "fireDepthThresholdReachedEvent" , "Control adapter is null, cannot fire event" ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "fireDepthThresholdReachedEvent" ) ; }
|
Fire an event notification of type TYPE_SIB_MESSAGEPOINT_DEPTH_THRESHOLD_REACHED
|
36,743
|
private void reschedule ( ) { Calendar cal = Calendar . getInstance ( ) ; long today = cal . getTimeInMillis ( ) ; cal . set ( Calendar . HOUR_OF_DAY , 0 ) ; cal . set ( Calendar . MINUTE , 0 ) ; cal . add ( Calendar . DATE , 1 ) ; long tomorrow = cal . getTimeInMillis ( ) ; if ( executorService != null ) { future = executorService . schedule ( this , tomorrow - today , TimeUnit . MILLISECONDS ) ; } }
|
Reschedule the task for midnight - ish the next day .
|
36,744
|
public void run ( ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "run: " + ivTimer . ivTaskId ) ; if ( serverStopping ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "Server shutting down; aborting" ) ; return ; } if ( ivRetries == 0 ) { ivTimer . calculateNextExpiration ( ) ; } ivTimer . checkLateTimerThreshold ( ) ; try { if ( ! ivTimer . isIvDestroyed ( ) ) { doWork ( ) ; } else { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "Timer has been cancelled; aborting" ) ; return ; } ivRetries = 0 ; ivTimer . scheduleNext ( ) ; } catch ( Throwable ex ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "NP Timer failed : " + ex . getClass ( ) . getName ( ) + ":" + ex . getMessage ( ) , ex ) ; } if ( ( ivRetryLimit != - 1 ) && ( ivRetries >= ivRetryLimit ) ) { ivTimer . calculateNextExpiration ( ) ; ivTimer . scheduleNext ( ) ; ivRetries = 0 ; Tr . warning ( tc , "NP_TIMER_RETRY_LIMIT_REACHED_CNTR0179W" , ivRetryLimit ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "Timer retry limit has been reached; aborting" ) ; return ; } ivRetries ++ ; if ( ivRetries == 1 ) { run ( ) ; } else { ivTimer . scheduleRetry ( ivRetryInterval ) ; } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "run" ) ; }
|
Executes the timer work with configured retries .
|
36,745
|
public static Document parseDocument ( DocumentBuilder builder , File file ) throws IOException , SAXException { final DocumentBuilder docBuilder = builder ; final File parsingFile = file ; try { return ( Document ) AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { public Object run ( ) throws SAXException , IOException { Thread currThread = Thread . currentThread ( ) ; ClassLoader oldLoader = currThread . getContextClassLoader ( ) ; currThread . setContextClassLoader ( ParserFactory . class . getClassLoader ( ) ) ; try { return docBuilder . parse ( parsingFile ) ; } finally { currThread . setContextClassLoader ( oldLoader ) ; } } } ) ; } catch ( PrivilegedActionException pae ) { Throwable t = pae . getCause ( ) ; if ( t instanceof SAXException ) { throw ( SAXException ) t ; } else if ( t instanceof IOException ) { throw ( IOException ) t ; } } return null ; }
|
D190462 - START
|
36,746
|
protected boolean checkBuffer ( ) throws IOException { if ( ! enableMultiReadofPostData ) { if ( null != this . buffer ) { if ( this . buffer . hasRemaining ( ) ) { return true ; } this . buffer . release ( ) ; this . buffer = null ; } try { this . buffer = this . isc . getRequestBodyBuffer ( ) ; if ( null != this . buffer ) { this . bytesRead += this . buffer . remaining ( ) ; return true ; } return false ; } catch ( IOException e ) { this . error = e ; throw e ; } } else { return checkMultiReadBuffer ( ) ; } }
|
Check the input buffer for data . If necessary attempt a read for a new buffer .
|
36,747
|
private boolean checkMultiReadBuffer ( ) throws IOException { if ( null != this . buffer ) { if ( this . buffer . hasRemaining ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "checkMultiReadBuffer, remaining ->" + this ) ; } return true ; } if ( firstReadCompleteforMulti ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "checkMultiReadBuffer, buffer is completely read, ready this buffer for the subsequent read ->" + this ) ; } postDataBuffer . get ( postDataIndex ) . flip ( ) ; postDataIndex ++ ; } else { this . buffer . release ( ) ; } this . buffer = null ; } if ( firstReadCompleteforMulti ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "checkMultiReadBuffer ,index ->" + postDataIndex + " ,storage.size ->" + postDataBuffer . size ( ) ) ; } if ( postDataBuffer . size ( ) <= postDataIndex ) { readRemainingFromChannel ( ) ; } if ( postDataBuffer . size ( ) > postDataIndex ) { this . buffer = postDataBuffer . get ( postDataIndex ) ; } if ( null != this . buffer ) { this . bytesReadFromStore += this . buffer . remaining ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "checkMultiReadBuffer ->" + this ) ; } return true ; } } else { if ( getBufferFromChannel ( ) ) { postDataBuffer . add ( postDataIndex , this . buffer . duplicate ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "checkMultiReadBuffer, buffer ->" + postDataBuffer . get ( postDataIndex ) + " ,buffersize ->" + postDataBuffer . size ( ) + " ,index ->" + postDataIndex ) ; } postDataIndex ++ ; this . bytesRead += this . buffer . remaining ( ) ; return true ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "checkMultiReadBuffer: no more buffer ->" + this ) ; } return false ; }
|
Check the input buffer for data . If necessary attempt a read for a new buffer and store it .
|
36,748
|
public static EsaSubsystemFeatureDefinitionImpl constructInstance ( File esa ) throws ZipException , IOException { ZipFile zip = new ZipFile ( esa ) ; Enumeration < ? extends ZipEntry > zipEntries = zip . entries ( ) ; ZipEntry subsystemEntry = null ; while ( zipEntries . hasMoreElements ( ) ) { ZipEntry nextEntry = zipEntries . nextElement ( ) ; if ( "OSGI-INF/SUBSYSTEM.MF" . equalsIgnoreCase ( nextEntry . getName ( ) ) ) { subsystemEntry = nextEntry ; } } return new EsaSubsystemFeatureDefinitionImpl ( zip . getInputStream ( subsystemEntry ) , zip ) ; }
|
Create a new instance of this class for the supplied ESA file .
|
36,749
|
static String formatTime ( ) { Date date = new Date ( ) ; DateFormat formatter = BaseTraceFormatter . useIsoDateFormat ? new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.SSSZ" ) : DateFormatProvider . getDateFormat ( ) ; StringBuffer answer = new StringBuffer ( ) ; answer . append ( '[' ) ; formatter . format ( date , answer , new FieldPosition ( 0 ) ) ; answer . append ( ']' ) ; return answer . toString ( ) ; }
|
Return the current time formatted in a standard way
|
36,750
|
private static String [ ] getCallStackFromStackTraceElement ( StackTraceElement [ ] exceptionCallStack ) { if ( exceptionCallStack == null ) return null ; String [ ] answer = new String [ exceptionCallStack . length ] ; for ( int i = 0 ; i < exceptionCallStack . length ; i ++ ) { answer [ exceptionCallStack . length - 1 - i ] = exceptionCallStack [ i ] . getClassName ( ) ; } return answer ; }
|
Create the call stack array expected by diagnostic modules from an array of StackTraceElements
|
36,751
|
private static String getPackageName ( String className ) { int end = className . lastIndexOf ( '.' ) ; return ( end > 0 ) ? className . substring ( 0 , end ) : "" ; }
|
Return the package name of a given class name
|
36,752
|
public String validateCookieName ( String cookieName , boolean quiet ) { if ( cookieName == null || cookieName . length ( ) == 0 ) { if ( ! quiet ) { Tr . error ( tc , "COOKIE_NAME_CANT_BE_EMPTY" ) ; } return CFG_DEFAULT_COOKIENAME ; } String cookieNameUc = cookieName . toUpperCase ( ) ; boolean valid = true ; for ( int i = 0 ; i < cookieName . length ( ) ; i ++ ) { String eval = cookieNameUc . substring ( i , i + 1 ) ; if ( ! validCookieChars . contains ( eval ) ) { if ( ! quiet ) { Tr . error ( tc , "COOKIE_NAME_INVALID" , new Object [ ] { cookieName , eval } ) ; } valid = false ; } } if ( ! valid ) { return CFG_DEFAULT_COOKIENAME ; } else { return cookieName ; } }
|
reset cookieName to default value if it is not valid
|
36,753
|
public void distributeBefore ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "distributeBefore" , this ) ; boolean setRollback = false ; try { coreDistributeBefore ( ) ; } catch ( Throwable exc ) { Tr . error ( tc , "WTRN0074_SYNCHRONIZATION_EXCEPTION" , new Object [ ] { "before_completion" , exc } ) ; _tran . setOriginalException ( exc ) ; setRollback = true ; } final List RRSsyncs = _syncs [ SYNC_TIER_RRS ] ; if ( RRSsyncs != null ) { for ( int j = 0 ; j < RRSsyncs . size ( ) ; j ++ ) { final Synchronization sync = ( Synchronization ) RRSsyncs . get ( j ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "driving RRS before sync[" + j + "]" , Util . identity ( sync ) ) ; try { sync . beforeCompletion ( ) ; } catch ( Throwable exc ) { Tr . error ( tc , "WTRN0074_SYNCHRONIZATION_EXCEPTION" , new Object [ ] { "before_completion" , exc } ) ; setRollback = true ; } } } if ( setRollback && _tran != null ) { try { _tran . setRollbackOnly ( ) ; } catch ( Exception ex ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setRollbackOnly raised exception" , ex ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeBefore" ) ; }
|
Distributes before completion operations to all registered Synchronization objects . If a synchronization raises an exception mark transaction for rollback .
|
36,754
|
public void distributeAfter ( int status ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "distributeAfter" , new Object [ ] { this , status } ) ; final List RRSsyncs = _syncs [ SYNC_TIER_RRS ] ; if ( RRSsyncs != null ) { final int RRSstatus = ( status == Status . STATUS_UNKNOWN ? Status . STATUS_COMMITTED : status ) ; for ( int j = RRSsyncs . size ( ) ; -- j >= 0 ; ) { final Synchronization sync = ( Synchronization ) RRSsyncs . get ( j ) ; try { if ( tc . isEntryEnabled ( ) ) Tr . event ( tc , "driving RRS after sync[" + j + "]" , Util . identity ( sync ) ) ; sync . afterCompletion ( RRSstatus ) ; } catch ( Throwable exc ) { Tr . error ( tc , "WTRN0074_SYNCHRONIZATION_EXCEPTION" , new Object [ ] { "after_completion" , exc } ) ; } } } coreDistributeAfter ( status ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeAfter" ) ; }
|
Distributes after completion operations to all registered Synchronization objects .
|
36,755
|
public static UDPBufferFactory getRef ( ) { if ( null == ofInstance ) { synchronized ( UDPBufferFactory . class ) { if ( null == ofInstance ) { ofInstance = new UDPBufferFactory ( ) ; } } } return ofInstance ; }
|
Get a reference to the singleton instance of this class .
|
36,756
|
public static UDPBufferImpl getUDPBuffer ( WsByteBuffer buffer , SocketAddress address ) { UDPBufferImpl udpBuffer = getRef ( ) . getUDPBufferImpl ( ) ; udpBuffer . set ( buffer , address ) ; return udpBuffer ; }
|
Get a UDPBuffer that will encapsulate the provided information .
|
36,757
|
protected UDPBufferImpl getUDPBufferImpl ( ) { UDPBufferImpl ret = ( UDPBufferImpl ) udpBufferObjectPool . get ( ) ; if ( ret == null ) { ret = new UDPBufferImpl ( this ) ; } return ret ; }
|
Retrieve an UDPBuffer object from the factory .
|
36,758
|
public String logDirectory ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "logDirectory" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "logDirectory" , _logDirectory ) ; return _logDirectory ; }
|
Returns the physical location where a recovery log constructed from the target object will reside .
|
36,759
|
public String logDirectoryStem ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "logDirectoryStem" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "logDirectoryStem" , _logDirectoryStem ) ; return _logDirectoryStem ; }
|
Returns the stem of the location where a recovery log constructed from the target object will reside .
|
36,760
|
public int logFileSize ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "logFileSize" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "logFileSize" , new Integer ( _logFileSize ) ) ; return _logFileSize ; }
|
Returns the physical log size of a recovery log constructed from the target object .
|
36,761
|
public int maxLogFileSize ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "maxLogFileSize" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "maxLogFileSize" , new Integer ( _maxLogFileSize ) ) ; return _maxLogFileSize ; }
|
Returns the maximum physical log size of a recovery log constructed from the target object .
|
36,762
|
void unregister ( ) { trackerLock . lock ( ) ; try { if ( tracker != null ) { tracker . close ( ) ; tracker = null ; } } finally { trackerLock . unlock ( ) ; } }
|
Unregisters all OSGi services associated with this bell
|
36,763
|
void update ( ) { final BundleContext context = componentContext . getBundleContext ( ) ; String libraryRef = library . id ( ) ; String libraryStatusFilter = String . format ( "(&(objectClass=%s)(|(id=%s)(service.pid=%s)))" , Library . class . getName ( ) , libraryRef , libraryRef ) ; Filter filter ; try { filter = context . createFilter ( libraryStatusFilter ) ; } catch ( InvalidSyntaxException e ) { throw new RuntimeException ( e ) ; } final Set < String > serviceNames = getServiceNames ( ( String [ ] ) config . get ( SERVICE_ATT ) ) ; ServiceTracker < Library , List < ServiceRegistration < ? > > > newTracker = null ; newTracker = new ServiceTracker < Library , List < ServiceRegistration < ? > > > ( context , filter , new ServiceTrackerCustomizer < Library , List < ServiceRegistration < ? > > > ( ) { public List < ServiceRegistration < ? > > addingService ( ServiceReference < Library > libraryRef ) { Library library = context . getService ( libraryRef ) ; return registerLibraryServices ( library , serviceNames ) ; } public void modifiedService ( ServiceReference < Library > libraryRef , List < ServiceRegistration < ? > > metaInfServices ) { } @ FFDCIgnore ( IllegalStateException . class ) public void removedService ( ServiceReference < Library > libraryRef , List < ServiceRegistration < ? > > metaInfServices ) { for ( ServiceRegistration < ? > registration : metaInfServices ) { try { registration . unregister ( ) ; } catch ( IllegalStateException e ) { } } context . ungetService ( libraryRef ) ; } } ) ; trackerLock . lock ( ) ; try { if ( tracker != null ) { tracker . close ( ) ; } tracker = newTracker ; tracker . open ( ) ; } finally { trackerLock . unlock ( ) ; } }
|
Configures this bell with a specific library and a possible set of service names
|
36,764
|
public static < T extends Constructible > T createObject ( Class < T > clazz ) { return OASFactoryResolver . instance ( ) . createObject ( clazz ) ; }
|
This method creates a new instance of a constructible element from the OpenAPI model tree .
|
36,765
|
private void printErrorMessage ( String key , Object ... substitutions ) { Tr . error ( tc , key , substitutions ) ; errorMsgIssued = true ; }
|
Prints the specified error message .
|
36,766
|
protected Object evaluateElExpression ( String expression , boolean mask ) { final String methodName = "evaluateElExpression" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , methodName , new Object [ ] { ( expression == null ) ? null : mask ? OBFUSCATED_STRING : expression , mask } ) ; } EvalPrivilegedAction evalPrivilegedAction = new EvalPrivilegedAction ( expression , mask ) ; Object result = AccessController . doPrivileged ( evalPrivilegedAction ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , methodName , ( result == null ) ? null : mask ? OBFUSCATED_STRING : result ) ; } return result ; }
|
Evaluate a possible EL expression .
|
36,767
|
static boolean isImmediateExpression ( String expression , boolean mask ) { final String methodName = "isImmediateExpression" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , methodName , new Object [ ] { ( expression == null ) ? null : mask ? OBFUSCATED_STRING : expression , mask } ) ; } boolean result = expression . startsWith ( "${" ) && expression . endsWith ( "}" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , methodName , result ) ; } return result ; }
|
Return whether the expression is an immediate EL expression .
|
36,768
|
static String removeBrackets ( String expression , boolean mask ) { final String methodName = "removeBrackets" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , methodName , new Object [ ] { ( expression == null ) ? null : mask ? OBFUSCATED_STRING : expression , mask } ) ; } expression = expression . trim ( ) ; if ( ( expression . startsWith ( "${" ) || expression . startsWith ( "#{" ) ) && expression . endsWith ( "}" ) ) { expression = expression . substring ( 2 , expression . length ( ) - 1 ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , methodName , ( expression == null ) ? null : mask ? OBFUSCATED_STRING : expression ) ; } return expression ; }
|
Remove the brackets from an EL expression .
|
36,769
|
@ SuppressWarnings ( "unchecked" ) private ThreadLocalProxyCopyOnWriteArraySet < ThreadLocalProxy < ? > > getProxySet ( ) { Object property = null ; property = bus . getProperty ( PROXY_SET ) ; if ( property == null ) { ThreadLocalProxyCopyOnWriteArraySet < ThreadLocalProxy < ? > > proxyMap = new ThreadLocalProxyCopyOnWriteArraySet < ThreadLocalProxy < ? > > ( ) ; bus . setProperty ( PROXY_SET , proxyMap ) ; property = proxyMap ; } return ( ThreadLocalProxyCopyOnWriteArraySet < ThreadLocalProxy < ? > > ) property ; }
|
Create a CopyOnWriteArraySet to store the ThreadLocalProxy objects for convenience of clearance
|
36,770
|
private void skipClasslessStackFrames ( ) { if ( classes . isEmpty ( ) ) return ; while ( elements . size ( ) > 0 && ! ! ! elements . peek ( ) . getClassName ( ) . equals ( classes . peek ( ) . getName ( ) ) ) { elements . pop ( ) ; } }
|
Call after any advancement to bring this . elements into line with this . classes .
|
36,771
|
public static boolean unregisterExtension ( String key ) { if ( key == null ) { throw new IllegalArgumentException ( "Parameter 'key' can not be null" ) ; } w . lock ( ) ; try { return extensionMap . remove ( key ) != null ; } finally { w . unlock ( ) ; } }
|
Removes context extension registration .
|
36,772
|
public static void getExtensions ( Map < String , String > map ) throws IllegalArgumentException { if ( map == null ) { throw new IllegalArgumentException ( "Parameter 'map' can not be null." ) ; } if ( recursion . get ( ) == Boolean . TRUE ) { return ; } recursion . set ( Boolean . TRUE ) ; LinkedList < String > cleanup = new LinkedList < String > ( ) ; r . lock ( ) ; try { for ( Map . Entry < String , WeakReference < Extension > > entry : extensionMap . entrySet ( ) ) { Extension extension = entry . getValue ( ) . get ( ) ; if ( extension == null ) { cleanup . add ( entry . getKey ( ) ) ; } else { String value = extension . getValue ( ) ; if ( value != null ) { map . put ( entry . getKey ( ) , value ) ; } } } } finally { r . unlock ( ) ; recursion . remove ( ) ; } if ( cleanup . size ( ) > 0 ) { w . lock ( ) ; try { for ( String key : cleanup ) { WeakReference < Extension > extension = extensionMap . remove ( key ) ; if ( extension != null && extension . get ( ) != null ) { extensionMap . put ( key , extension ) ; } } } finally { w . unlock ( ) ; } } if ( extensions . get ( ) != null ) { for ( Entry < String , String > entry : extensions . get ( ) . entrySet ( ) ) { map . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } } }
|
Retrieves values for all registered context extensions .
|
36,773
|
@ FFDCIgnore ( Exception . class ) private void logProviderInfo ( String providerName , ClassLoader loader ) { try { if ( PROVIDER_ECLIPSELINK . equals ( providerName ) ) { Class < ? > Version = loadClass ( loader , "org.eclipse.persistence.Version" ) ; String version = ( String ) Version . getMethod ( "getVersionString" ) . invoke ( Version . newInstance ( ) ) ; Tr . info ( tc , "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I" , "EclipseLink" , version ) ; } else if ( PROVIDER_HIBERNATE . equals ( providerName ) ) { Class < ? > Version = loadClass ( loader , "org.hibernate.Version" ) ; String version = ( String ) Version . getMethod ( "getVersionString" ) . invoke ( null ) ; Tr . info ( tc , "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I" , "Hibernate" , version ) ; } else if ( PROVIDER_OPENJPA . equals ( providerName ) ) { StringBuilder version = new StringBuilder ( ) ; Class < ? > OpenJPAVersion = loadClass ( loader , "org.apache.openjpa.conf.OpenJPAVersion" ) ; OpenJPAVersion . getMethod ( "appendOpenJPABanner" , StringBuilder . class ) . invoke ( OpenJPAVersion . newInstance ( ) , version ) ; Tr . info ( tc , "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I" , "OpenJPA" , version ) ; } else { Tr . info ( tc , "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I" , providerName ) ; } } catch ( Exception x ) { Tr . info ( tc , "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I" , providerName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "unable to determine provider info" , x ) ; } }
|
Log version information about the specified persistence provider if it can be determined .
|
36,774
|
protected void checkStartStatus ( BundleStartStatus startStatus ) throws InvalidBundleContextException { final String m = "checkInstallStatus" ; if ( startStatus . startExceptions ( ) ) { Map < Bundle , Throwable > startExceptions = startStatus . getStartExceptions ( ) ; for ( Entry < Bundle , Throwable > entry : startExceptions . entrySet ( ) ) { Bundle b = entry . getKey ( ) ; FFDCFilter . processException ( entry . getValue ( ) , ME , m , this , new Object [ ] { b . getLocation ( ) } ) ; } throw new LaunchException ( "Exceptions occurred while starting platform bundles" , BootstrapConstants . messages . getString ( "error.platformBundleException" ) ) ; } if ( ! startStatus . contextIsValid ( ) ) throw new InvalidBundleContextException ( ) ; }
|
Check the passed in start status for exceptions starting bundles and issue appropriate diagnostics & messages for this environment .
|
36,775
|
protected BundleInstallStatus installBundles ( BootstrapConfig config ) throws InvalidBundleContextException { BundleInstallStatus installStatus = new BundleInstallStatus ( ) ; KernelResolver resolver = config . getKernelResolver ( ) ; ContentBasedLocalBundleRepository repo = BundleRepositoryRegistry . getInstallBundleRepository ( ) ; List < KernelBundleElement > bundleList = resolver . getKernelBundles ( ) ; if ( bundleList == null || bundleList . size ( ) <= 0 ) return installStatus ; boolean libertyBoot = Boolean . parseBoolean ( config . get ( BootstrapConstants . LIBERTY_BOOT_PROPERTY ) ) ; for ( final KernelBundleElement element : bundleList ) { if ( libertyBoot ) { installLibertBootBundle ( element , installStatus ) ; } else { installKernelBundle ( element , installStatus , repo ) ; } } return installStatus ; }
|
Install framework bundles .
|
36,776
|
public synchronized boolean isHealthy ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isHealthy" ) ; boolean retval = _running && ! _stopRequested && ( _threadWriteErrorsOutstanding == 0 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isHealthy" , Boolean . valueOf ( retval ) ) ; return retval ; }
|
Used as a quick way to check the health of a dispatcher before giving it work in situations in which the work cannot be rejected . For example for a transaction which requires both synchronous and asynchronous persistence once we ve done the synchronous persistence a transient persistence problem from a dispatcher will not be reported from the dispatching method because we cannot guarantee to roll back the synchronous work .
|
36,777
|
private String getLogDir ( ) { StringBuffer output = new StringBuffer ( ) ; WsLocationAdmin locationAdmin = locationAdminRef . getService ( ) ; output . append ( locationAdmin . resolveString ( "${server.output.dir}" ) . replace ( '\\' , '/' ) ) . append ( "/logs" ) ; return output . toString ( ) ; }
|
Get the default directory for logs
|
36,778
|
private String mapToJSONString ( Map < String , Object > eventMap ) { JSONObject jsonEvent = new JSONObject ( ) ; String jsonString = null ; map2JSON ( jsonEvent , eventMap ) ; try { if ( ! compact ) { jsonString = jsonEvent . serialize ( true ) . replaceAll ( "\\\\/" , "/" ) ; } else { jsonString = jsonEvent . toString ( ) ; } } catch ( IOException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unexpected error converting AuditEvent to JSON String" , e ) ; } } return jsonString ; }
|
Produce a JSON String for the given audit event
|
36,779
|
private JSONArray array2JSON ( JSONArray ja , Object [ ] array ) { for ( int i = 0 ; i < array . length ; i ++ ) { if ( array [ i ] instanceof Map ) { ja . add ( map2JSON ( new JSONObject ( ) , ( Map < String , Object > ) array [ i ] ) ) ; } else if ( array [ i ] . getClass ( ) . isArray ( ) ) { ja . add ( array2JSON ( new JSONArray ( ) , ( Object [ ] ) array [ i ] ) ) ; } else { ja . add ( array [ i ] ) ; } } return ja ; }
|
Given a Java array add the corresponding JSON to the given JSONArray object
|
36,780
|
public void writeBootstrapProperty ( LibertyServer server , String propKey , String propValue ) throws Exception { String bootProps = getBootstrapPropertiesFilePath ( server ) ; appendBootstrapPropertyToFile ( bootProps , propKey , propValue ) ; }
|
Writes the specified bootstrap property and value to the provided server s bootstrap . properties file .
|
36,781
|
public void writeBootstrapProperties ( LibertyServer server , Map < String , String > miscParms ) throws Exception { String thisMethod = "writeBootstrapProperties" ; loggingUtils . printMethodName ( thisMethod ) ; if ( miscParms == null ) { return ; } String bootPropFilePath = getBootstrapPropertiesFilePath ( server ) ; for ( Map . Entry < String , String > entry : miscParms . entrySet ( ) ) { appendBootstrapPropertyToFile ( bootPropFilePath , entry . getKey ( ) , entry . getValue ( ) ) ; } }
|
Writes each of the specified bootstrap properties and values to the provided server s bootstrap . properties file .
|
36,782
|
public static WSATRecoveryCoordinator fromLogData ( byte [ ] bytes ) throws SystemException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "fromLogData" , bytes ) ; WSATRecoveryCoordinator wsatRC = null ; final ByteArrayInputStream bais = new ByteArrayInputStream ( bytes ) ; try { final ObjectInputStream ois = new ObjectInputStream ( bais ) ; final Object obj = ois . readObject ( ) ; wsatRC = ( WSATRecoveryCoordinator ) obj ; } catch ( Throwable e ) { FFDCFilter . processException ( e , "com.ibm.ws.Transaction.wstx.WSATRecoveryCoordinator.fromLogData" , "67" ) ; final Throwable se = new SystemException ( ) . initCause ( e ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "fromLogData" , se ) ; throw ( SystemException ) se ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "fromLogData" , wsatRC ) ; return wsatRC ; }
|
As called after recovery on distributed platform
|
36,783
|
private boolean handleAdditionalAnnotation ( List < Parameter > parameters , Annotation annotation , final Type type , Set < Type > typesToSkip , javax . ws . rs . Consumes classConsumes , javax . ws . rs . Consumes methodConsumes , Components components , boolean includeRequestBody ) { boolean processed = false ; if ( BeanParam . class . isAssignableFrom ( annotation . getClass ( ) ) ) { final BeanDescription beanDesc = mapper . getSerializationConfig ( ) . introspect ( constructType ( type ) ) ; final List < BeanPropertyDefinition > properties = beanDesc . findProperties ( ) ; for ( final BeanPropertyDefinition propDef : properties ) { final AnnotatedField field = propDef . getField ( ) ; final AnnotatedMethod setter = propDef . getSetter ( ) ; final AnnotatedMethod getter = propDef . getGetter ( ) ; final List < Annotation > paramAnnotations = new ArrayList < Annotation > ( ) ; final Iterator < OpenAPIExtension > extensions = OpenAPIExtensions . chain ( ) ; Type paramType = null ; if ( field != null ) { paramType = field . getType ( ) ; for ( final Annotation fieldAnnotation : field . annotations ( ) ) { if ( ! paramAnnotations . contains ( fieldAnnotation ) ) { paramAnnotations . add ( fieldAnnotation ) ; } } } if ( setter != null ) { if ( paramType == null ) { paramType = setter . getParameterType ( 0 ) ; } for ( final Annotation fieldAnnotation : setter . annotations ( ) ) { if ( ! paramAnnotations . contains ( fieldAnnotation ) ) { paramAnnotations . add ( fieldAnnotation ) ; } } } if ( getter != null ) { if ( paramType == null ) { paramType = getter . getType ( ) ; } for ( final Annotation fieldAnnotation : getter . annotations ( ) ) { if ( ! paramAnnotations . contains ( fieldAnnotation ) ) { paramAnnotations . add ( fieldAnnotation ) ; } } } if ( paramType == null ) { continue ; } List < Parameter > extracted = extensions . next ( ) . extractParameters ( paramAnnotations , paramType , typesToSkip , components , classConsumes , methodConsumes , includeRequestBody , extensions ) . parameters ; for ( Parameter p : extracted ) { if ( ParameterProcessor . applyAnnotations ( p , paramType , paramAnnotations , components , classConsumes == null ? new String [ 0 ] : classConsumes . value ( ) , methodConsumes == null ? new String [ 0 ] : methodConsumes . value ( ) ) != null ) { parameters . add ( p ) ; } } processed = true ; } } return processed ; }
|
Adds additional annotation processing support
|
36,784
|
protected String replaceAllProperties ( String str , final Properties submittedProps , final Properties xmlProperties ) { int startIndex = 0 ; NextProperty nextProp = this . findNextProperty ( str , startIndex ) ; while ( nextProp != null ) { startIndex = nextProp . endIndex ; String nextPropValue = this . resolvePropertyValue ( nextProp . propName , nextProp . propType , submittedProps , xmlProperties ) ; if ( nextPropValue . equals ( UNRESOLVED_PROP_VALUE ) ) { if ( nextProp . defaultValueExpression != null ) { nextPropValue = this . replaceAllProperties ( nextProp . defaultValueExpression , submittedProps , xmlProperties ) ; } } int lengthDifference = 0 ; switch ( nextProp . propType ) { case JOB_PARAMETERS : lengthDifference = nextPropValue . length ( ) - ( nextProp . propName . length ( ) + "#{jobParameters['']}" . length ( ) ) ; startIndex = startIndex + lengthDifference ; str = str . replace ( "#{jobParameters['" + nextProp . propName + "']}" + nextProp . getDefaultValExprWithDelimitersIfExists ( ) , nextPropValue ) ; break ; case JOB_PROPERTIES : lengthDifference = nextPropValue . length ( ) - ( nextProp . propName . length ( ) + "#{jobProperties['']}" . length ( ) ) ; startIndex = startIndex + lengthDifference ; str = str . replace ( "#{jobProperties['" + nextProp . propName + "']}" + nextProp . getDefaultValExprWithDelimitersIfExists ( ) , nextPropValue ) ; break ; case SYSTEM_PROPERTIES : lengthDifference = nextPropValue . length ( ) - ( nextProp . propName . length ( ) + "#{systemProperties['']}" . length ( ) ) ; startIndex = startIndex + lengthDifference ; str = str . replace ( "#{systemProperties['" + nextProp . propName + "']}" + nextProp . getDefaultValExprWithDelimitersIfExists ( ) , nextPropValue ) ; break ; case PARTITION_PROPERTIES : lengthDifference = nextPropValue . length ( ) - ( nextProp . propName . length ( ) + "#{partitionPlan['']}" . length ( ) ) ; startIndex = startIndex + lengthDifference ; str = str . replace ( "#{partitionPlan['" + nextProp . propName + "']}" + nextProp . getDefaultValExprWithDelimitersIfExists ( ) , nextPropValue ) ; break ; } nextProp = this . findNextProperty ( str , startIndex ) ; } return str ; }
|
Replace all the properties in String str .
|
36,785
|
private String resolvePropertyValue ( final String name , PROPERTY_TYPE propType , final Properties submittedProperties , final Properties xmlProperties ) { String value = null ; switch ( propType ) { case JOB_PARAMETERS : if ( submittedProperties != null ) { value = submittedProperties . getProperty ( name ) ; } if ( value != null ) { return value ; } break ; case JOB_PROPERTIES : if ( xmlProperties != null ) { value = xmlProperties . getProperty ( name ) ; } if ( value != null ) { return value ; } break ; case SYSTEM_PROPERTIES : value = System . getProperty ( name ) ; if ( value != null ) { return value ; } break ; case PARTITION_PROPERTIES : if ( submittedProperties != null ) { value = submittedProperties . getProperty ( name ) ; } if ( value != null ) { return value ; } break ; } return UNRESOLVED_PROP_VALUE ; }
|
Gets the value of a property using the property type
|
36,786
|
private Properties inheritProperties ( final Properties parentProps , final Properties childProps ) { if ( parentProps == null ) { return childProps ; } if ( childProps == null ) { return parentProps ; } for ( final String parentKey : parentProps . stringPropertyNames ( ) ) { if ( ! childProps . containsKey ( parentKey ) ) { childProps . setProperty ( parentKey , parentProps . getProperty ( parentKey ) ) ; } } return childProps ; }
|
Merge the parent properties that are already set into the child properties . Child properties always override parent values .
|
36,787
|
public boolean isCommitted ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "isCommitted: " + committed ) ; } return committed ; }
|
Returns whether the output has been committed or not .
|
36,788
|
public void write ( int c ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "write + c ) ; } if ( ! _hasWritten && obs != null ) { _hasWritten = true ; obs . alertFirstWrite ( ) ; } if ( limit > - 1 ) { if ( total >= limit ) { throw new WriteBeyondContentLengthException ( ) ; } } if ( count == buf . length ) { response . setFlushMode ( false ) ; flushChars ( ) ; response . setFlushMode ( true ) ; } buf [ count ++ ] = ( char ) c ; total ++ ; }
|
Writes a char . This method will block until the char is actually written .
|
36,789
|
protected void flushChars ( ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "flushChars" ) ; } if ( ! committed ) { if ( ! _hasFlushed && obs != null ) { _hasFlushed = true ; obs . alertFirstFlush ( ) ; } } committed = true ; if ( count > 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "flushChars, Count = " + count ) ; } writeOut ( buf , 0 , count ) ; count = 0 ; } else { if ( response . getFlushMode ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "flushChars, Count 0 still flush mode is true , forceful flush" ) ; } response . flushBufferedContent ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "flushChars, flush mode is false" ) ; } } } }
|
Flushes the writer chars .
|
36,790
|
private void addAddressToList ( String newAddress , boolean validateOnly ) { int start = 0 ; char delimiter = '.' ; String sub ; int radix = 10 ; int addressToAdd [ ] = new int [ IP_ADDR_NUMBERS ] ; for ( int i = 0 ; i < IP_ADDR_NUMBERS ; i ++ ) { addressToAdd [ i ] = 0 ; } int slot = IP_ADDR_NUMBERS - 1 ; if ( newAddress . indexOf ( '.' ) == - 1 ) { delimiter = ':' ; radix = 16 ; } String addr = newAddress ; while ( true ) { start = addr . lastIndexOf ( delimiter ) ; if ( start != - 1 ) { sub = addr . substring ( start + 1 ) ; if ( sub . trim ( ) . equals ( "*" ) ) { addressToAdd [ slot ] = - 1 ; } else { addressToAdd [ slot ] = Integer . parseInt ( sub , radix ) ; } } else { if ( addr . trim ( ) . equals ( "*" ) ) { addressToAdd [ slot ] = - 1 ; } else { addressToAdd [ slot ] = Integer . parseInt ( addr , radix ) ; } break ; } slot = slot - 1 ; addr = addr . substring ( 0 , start ) ; } if ( ! validateOnly ) { putInList ( addressToAdd ) ; } }
|
Add one IPv4 or IPv6 address to the tree . The address is passed in as a string and converted to an integer array by this routine . Another method is then called to put it into the tree
|
36,791
|
public boolean findInList ( byte [ ] address ) { int len = address . length ; int a [ ] = new int [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { a [ i ] = address [ i ] & 0x00FF ; } return findInList ( a ) ; }
|
Determine if an address represented by a byte array is in the address tree
|
36,792
|
public boolean findInList6 ( byte [ ] address ) { int len = address . length ; int a [ ] = new int [ len / 2 ] ; int j = 0 ; int highOrder = 0 ; int lowOrder = 0 ; for ( int i = 0 ; i < len ; i += 2 ) { highOrder = address [ i ] & 0x00FF ; lowOrder = address [ i + 1 ] & 0x00FF ; a [ j ] = highOrder * 256 + lowOrder ; j ++ ; } return findInList ( a ) ; }
|
Determine if an IPv6 address represented by a byte array is in the address tree
|
36,793
|
public boolean findInList ( int [ ] address ) { int len = address . length ; if ( len < IP_ADDR_NUMBERS ) { int j = IP_ADDR_NUMBERS - 1 ; int a [ ] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ; for ( int i = len ; i > 0 ; i -- , j -- ) { a [ j ] = address [ i - 1 ] ; } return findInList ( a , 0 , firstCell , 7 ) ; } return findInList ( address , 0 , firstCell , ( address . length - 1 ) ) ; }
|
Determine if an address represented by an integer array is in the address tree
|
36,794
|
private boolean findInList ( int [ ] address , int index , FilterCell cell , int endIndex ) { if ( cell . getWildcardCell ( ) != null ) { if ( index == endIndex ) { return true ; } FilterCell newcell = cell . getWildcardCell ( ) ; if ( findInList ( address , index + 1 , newcell , endIndex ) ) { return true ; } FilterCell nextCell = cell . findNextCell ( address [ index ] ) ; if ( nextCell != null ) { if ( index == endIndex ) { return true ; } return findInList ( address , index + 1 , nextCell , endIndex ) ; } return false ; } FilterCell nextCell = cell . findNextCell ( address [ index ] ) ; if ( nextCell != null ) { if ( index == endIndex ) { return true ; } return findInList ( address , index + 1 , nextCell , endIndex ) ; } return false ; }
|
Determine recursively if an address represented by an integer array is in the address tree
|
36,795
|
public boolean isInstrumentableMethod ( int access , String methodName , String descriptor ) { if ( ( access & Opcodes . ACC_SYNTHETIC ) != 0 ) { return false ; } if ( ( access & Opcodes . ACC_NATIVE ) != 0 ) { return false ; } if ( ( access & Opcodes . ACC_ABSTRACT ) != 0 ) { return false ; } if ( methodName . equals ( "toString" ) && descriptor . equals ( "()Ljava/lang/String;" ) ) { return false ; } if ( methodName . equals ( "hashCode" ) && descriptor . equals ( "()I" ) ) { return false ; } return true ; }
|
Indicate whether or not the target method is instrumentable .
|
36,796
|
@ Mode ( TestMode . LITE ) public void MPJwtBadMPConfigAsSystemProperties_GoodMpJwtConfigSpecifiedInServerXml ( ) throws Exception { resourceServer . reconfigureServerUsingExpandedConfiguration ( _testName , "rs_server_AltConfigNotInApp_goodServerXmlConfig.xml" ) ; standardTestFlow ( resourceServer , MpJwtFatConstants . NO_MP_CONFIG_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . NO_MP_CONFIG_IN_APP_APP , MpJwtFatConstants . MPJWT_APP_CLASS_NO_MP_CONFIG_IN_APP ) ; }
|
The server will be started with all mp - config properties incorrectly configured in the jvm . options file . The server . xml has a valid mp_jwt config specified . The config settings should come from server . xml . The test should run successfully .
|
36,797
|
@ FFDCIgnore ( JobExecutionNotRunningException . class ) public void stop ( ) { StopLock stopLock = getStopLock ( ) ; synchronized ( stopLock ) { if ( isStepStartingOrStarted ( ) ) { updateStepBatchStatus ( BatchStatus . STOPPING ) ; for ( BatchPartitionWorkUnit subJob : parallelBatchWorkUnits ) { try { getBatchKernelService ( ) . stopWorkUnit ( subJob ) ; } catch ( JobExecutionNotRunningException e ) { logger . fine ( "Caught exception trying to stop work unit: " + subJob + ", which was not running." ) ; } catch ( Exception e ) { throw new IllegalStateException ( e ) ; } } } else { logger . fine ( "Ignoring stop, since step not in a state which has a valid status (might not be far enough along to have a state yet)" ) ; } } }
|
The body of this method is synchronized with startPartition to close timing windows so that a new partition doesn t get started after this method has gone thru and stopped all currently running partitions .
|
36,798
|
private void setExecutionTypeIfNotSet ( ExecutionType executionType ) { if ( this . executionType == null ) { logger . finer ( "Setting initial execution type value" ) ; this . executionType = executionType ; } else { logger . finer ( "Not setting execution type value since it's already set" ) ; } }
|
We could be more aggressive about validating illegal states and throwing exceptions here .
|
36,799
|
private void validatePlanNumberOfPartitions ( PartitionPlanDescriptor currentPlan ) { int numPreviousPartitions = getTopLevelStepInstance ( ) . getPartitionPlanSize ( ) ; int numCurrentPartitions = currentPlan . getNumPartitionsInPlan ( ) ; if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "For step: " + getStepName ( ) + ", previous num partitions = " + numPreviousPartitions + ", and current num partitions = " + numCurrentPartitions ) ; } if ( executionType == ExecutionType . RESTART_NORMAL ) { if ( numPreviousPartitions == EntityConstants . PARTITION_PLAN_SIZE_UNINITIALIZED ) { logger . fine ( "For step: " + getStepName ( ) + ", previous num partitions has not been initialized, so don't validate the current plan size against it" ) ; } else if ( numCurrentPartitions != numPreviousPartitions ) { throw new IllegalArgumentException ( "Partition not configured for override, and previous execution used " + numPreviousPartitions + " number of partitions, while current plan uses a different number: " + numCurrentPartitions ) ; } } if ( numCurrentPartitions < 1 ) { throw new IllegalArgumentException ( "Partition plan size is calculated as " + numCurrentPartitions + ", but at least one partition is needed." ) ; } }
|
Verify the number of partitions in the plan makes sense .
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.