idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
160,000 | public static boolean repositoryDescriptionFileExists ( RestRepositoryConnectionProxy proxy ) { boolean exists = false ; try { URL propertiesFileURL = getPropertiesFileLocation ( ) ; // Are we accessing the properties file (from DHE) using a proxy ? if ( proxy != null ) { if ( proxy . isHTTPorHTTPS ( ) ) { Proxy javaNetProxy = new Proxy ( Proxy . Type . HTTP , new InetSocketAddress ( proxy . getProxyURL ( ) . getHost ( ) , proxy . getProxyURL ( ) . getPort ( ) ) ) ; URLConnection connection = propertiesFileURL . openConnection ( javaNetProxy ) ; InputStream is = connection . getInputStream ( ) ; exists = true ; is . close ( ) ; if ( connection instanceof HttpURLConnection ) { ( ( HttpURLConnection ) connection ) . disconnect ( ) ; } } else { // The proxy is not an HTTP or HTTPS proxy we do not support this UnsupportedOperationException ue = new UnsupportedOperationException ( "Non-HTTP proxy not supported" ) ; throw new IOException ( ue ) ; } } else { // not using a proxy InputStream is = propertiesFileURL . openStream ( ) ; exists = true ; is . close ( ) ; } } catch ( MalformedURLException e ) { // ignore } catch ( IOException e ) { // ignore } return exists ; } | Tests if the repository description properties file exists as defined by the location override system property or at the default location | 297 | 22 |
160,001 | private static void checkHttpResponseCodeValid ( URLConnection connection ) throws RepositoryHttpException , IOException { // if HTTP URL not File URL if ( connection instanceof HttpURLConnection ) { HttpURLConnection conn = ( HttpURLConnection ) connection ; conn . setRequestMethod ( "GET" ) ; int respCode = conn . getResponseCode ( ) ; if ( respCode < 200 || respCode >= 300 ) { throw new RepositoryHttpException ( "HTTP connection returned error code " + respCode , respCode , null ) ; } } } | Checks for a valid response code and throws and exception with the response code if an error | 117 | 18 |
160,002 | public static boolean isZos ( ) { String os = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { @ Override public String run ( ) { return System . getProperty ( "os.name" ) ; } } ) ; return os != null && ( os . equalsIgnoreCase ( "OS/390" ) || os . equalsIgnoreCase ( "z/OS" ) ) ; } | In general find another way to do what you are trying this is meant as a VERY VERY last resort and agreed to by Gary . | 91 | 26 |
160,003 | private InputStream safeOpen ( String file ) { URL url = bundle . getEntry ( file ) ; if ( url != null ) { try { return url . openStream ( ) ; } catch ( IOException e ) { // if we get an IOException just return null for default page. } } return null ; } | Attempt to open the file in the bundle and return null if something goes wrong . | 66 | 16 |
160,004 | public static String parseTempPrefix ( String destinationName ) { //Temporary dests are of the form _Q/_T<Prefix>_<MEId><TempdestId> String prefix = null ; if ( destinationName != null && ( destinationName . startsWith ( SIMPConstants . TEMPORARY_PUBSUB_DESTINATION_PREFIX ) ) || destinationName . startsWith ( SIMPConstants . TEMPORARY_QUEUE_DESTINATION_PREFIX ) ) { int index = destinationName . indexOf ( SIMPConstants . SYSTEM_DESTINATION_SEPARATOR , 2 ) ; if ( index > 1 ) { prefix = destinationName . substring ( 2 , index ) ; } } return prefix ; } | Used to extract the destination prefix component of a full temporary destination name . | 168 | 14 |
160,005 | public static void setGuaranteedDeliveryProperties ( ControlMessage msg , SIBUuid8 sourceMEUuid , SIBUuid8 targetMEUuid , SIBUuid12 streamId , SIBUuid12 gatheringTargetDestUuid , SIBUuid12 targetDestUuid , ProtocolType protocolType , byte protocolVersion ) { // Remote to local message properties msg . setGuaranteedSourceMessagingEngineUUID ( sourceMEUuid ) ; msg . setGuaranteedTargetMessagingEngineUUID ( targetMEUuid ) ; msg . setGuaranteedStreamUUID ( streamId ) ; msg . setGuaranteedGatheringTargetUUID ( gatheringTargetDestUuid ) ; msg . setGuaranteedTargetDestinationDefinitionUUID ( targetDestUuid ) ; if ( protocolType != null ) msg . setGuaranteedProtocolType ( protocolType ) ; msg . setGuaranteedProtocolVersion ( protocolVersion ) ; } | Set up guaranteed delivery message properties . These are compulsory properties on a control message and are therefore set throughout the code . The method makes it easier to cope with new properties in the message . | 206 | 37 |
160,006 | @ Override // Don't log this call: Rely on 'intern(String, boolean)' to log the intern call and result. @ Trivial public String intern ( String value ) { return intern ( value , Util_InternMap . DO_FORCE ) ; } | Intern a string value . Do force the value to be interned . | 58 | 14 |
160,007 | public boolean isChanged ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isChanged" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isChanged" , changed ) ; return changed ; } | Is the map fluffed up into a HashMap? d317373 . 1 | 87 | 16 |
160,008 | public void setUnChanged ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setUnChanged" ) ; changed = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setUnChanged" ) ; } | Set the changed flag back to false if the map is written back to JMF | 89 | 16 |
160,009 | public void setChanged ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setChanged" ) ; changed = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setChanged" ) ; } | Set the changed flag to true if the caller knows better than the map itself | 86 | 15 |
160,010 | public Object put ( String key , Object value ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "put" , new Object [ ] { key , PasswordUtils . replaceValueIfKeyIsPassword ( key , value ) } ) ; // If the value is null (which is allowed for a Map Message) we can't tell // quickly whether the item is already in the map as null, or whether it doesn't exist, // so we just assume it will cause a change. // For properties we will never get a value of null, and it is properties we are really concerned with. if ( ( ! changed ) && ( value != null ) ) { Object old = get ( key ) ; if ( value . equals ( old ) ) { // may as well call equals immediately, as it checks for == and we know value!=null if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "put" , "unchanged" ) ; return old ; } else { changed = true ; Object result = copyMap ( ) . put ( key , value ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "put" , PasswordUtils . replaceValueIfKeyIsPassword ( key , result ) ) ; return result ; } } else { changed = true ; Object result = copyMap ( ) . put ( key , value ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "put" , PasswordUtils . replaceValueIfKeyIsPassword ( key , result ) ) ; return result ; } } | Once we ve made one update others don t matter so save time by not checking . d317373 . 1 | 396 | 22 |
160,011 | public void addWebServiceFeatureInfo ( String seiName , WebServiceFeatureInfo featureInfo ) { PortComponentRefInfo portComponentRefInfo = seiNamePortComponentRefInfoMap . get ( seiName ) ; if ( portComponentRefInfo == null ) { portComponentRefInfo = new PortComponentRefInfo ( seiName ) ; seiNamePortComponentRefInfoMap . put ( seiName , portComponentRefInfo ) ; } portComponentRefInfo . addWebServiceFeatureInfo ( featureInfo ) ; } | Add a feature info to the PortComponentRefInfo if the target one does not exist a new one with that port component interface will be created | 110 | 28 |
160,012 | @ Trivial final String getName ( ) { Map < String , String > execProps = getExecutionProperties ( ) ; String taskName = execProps == null ? null : execProps . get ( ManagedTask . IDENTITY_NAME ) ; return taskName == null ? task . toString ( ) : taskName ; } | Returns the task name . | 75 | 5 |
160,013 | public static WASConfiguration getDefaultWasConfiguration ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getDefaultWasConfiguration()" ) ; WASConfiguration config = new WASConfiguration ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getDefaultWasConfiguration()" , config ) ; return ( config ) ; } | Create a new WASConfiguration object | 105 | 6 |
160,014 | public void performRecovery ( ObjectManagerState objectManagerState ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "performRecovery" , "ObjectManagerState=" + objectManagerState ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isDebugEnabled ( ) ) trace . debug ( this , cclass , "logicalUnitOfWork.identifier=" + logicalUnitOfWork . identifier + "(long)" ) ; Transaction transactionForRecovery = objectManagerState . getTransaction ( logicalUnitOfWork ) ; transactionForRecovery . commit ( false ) ; // Do not re use this Transaction. if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "performRecovery" ) ; } | Called to perform recovery action during a warm start of the objectManager . | 195 | 15 |
160,015 | public void initialize ( CacheConfig cc ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "initialize" ) ; cacheConfig = cc ; if ( null != cc ) { try { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Initializing CacheUnit " + uniqueServerNameFQ ) ; nullRemoteServices . setCacheUnit ( uniqueServerNameFQ , this ) ; } catch ( Exception ex ) { //ex.printStackTrace(); com . ibm . ws . ffdc . FFDCFilter . processException ( ex , "com.ibm.ws.cache.CacheUnitImpl.initialize" , "120" , this ) ; Tr . error ( tc , "dynacache.configerror" , ex . getMessage ( ) ) ; throw new IllegalStateException ( "Unexpected exception: " + ex . getMessage ( ) ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "initialize" ) ; } | This is a helper method called by this CacheUnitImpl s constructor . It creates all the local objects - BatchUpdateDaemon InvalidationAuditDaemon and TimeLimitDaemon . These objects are used by all cache instances . | 223 | 47 |
160,016 | public void batchUpdate ( String cacheName , HashMap invalidateIdEvents , HashMap invalidateTemplateEvents , ArrayList pushEntryEvents ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "batchUpdate():" + cacheName ) ; invalidationAuditDaemon . registerInvalidations ( cacheName , invalidateIdEvents . values ( ) . iterator ( ) ) ; invalidationAuditDaemon . registerInvalidations ( cacheName , invalidateTemplateEvents . values ( ) . iterator ( ) ) ; pushEntryEvents = invalidationAuditDaemon . filterEntryList ( cacheName , pushEntryEvents ) ; DCache cache = ServerCache . getCache ( cacheName ) ; if ( cache != null ) { cache . batchUpdate ( invalidateIdEvents , invalidateTemplateEvents , pushEntryEvents ) ; if ( cache . getCacheConfig ( ) . isEnableServletSupport ( ) == true ) { if ( servletCacheUnit != null ) { servletCacheUnit . invalidateExternalCaches ( invalidateIdEvents , invalidateTemplateEvents ) ; } else { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "batchUpdate() cannot do invalidateExternalCaches because servletCacheUnit=NULL." ) ; } } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "batchUpdate()" ) ; } | This implements the method in the CacheUnit interface . It applies the updates to the local internal caches and the external caches . It validates timestamps to prevent race conditions . | 296 | 35 |
160,017 | public CacheEntry getEntry ( String cacheName , Object id , boolean ignoreCounting ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getEntry: {0}" , id ) ; DCache cache = ServerCache . getCache ( cacheName ) ; CacheEntry cacheEntry = null ; if ( cache != null ) { cacheEntry = ( CacheEntry ) cache . getEntry ( id , CachePerf . REMOTE , ignoreCounting , DCacheBase . INCREMENT_REFF_COUNT ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getEntry: {0}" , id ) ; return cacheEntry ; } | This implements the method in the CacheUnit interface . This is called by DRSNotificationService and DRSMessageListener . A returned null indicates that the local cache should execute it and return the result to the coordinating CacheUnit . | 147 | 46 |
160,018 | public void setEntry ( String cacheName , CacheEntry cacheEntry ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setEntry: {0}" , cacheEntry . id ) ; cacheEntry = invalidationAuditDaemon . filterEntry ( cacheName , cacheEntry ) ; if ( cacheEntry != null ) { DCache cache = ServerCache . getCache ( cacheName ) ; cache . setEntry ( cacheEntry , CachePerf . REMOTE ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setEntry: {0}" , cacheEntry == null ? "null" : cacheEntry . id ) ; } | This implements the method in the CacheUnit interface . This is called by DRSNotificationService and DRSMessageListener . | 144 | 25 |
160,019 | public void setExternalCacheFragment ( ExternalInvalidation externalCacheFragment ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "setExternalCacheFragment: {0}" , externalCacheFragment . getUri ( ) ) ; externalCacheFragment = invalidationAuditDaemon . filterExternalCacheFragment ( ServerCache . cache . getCacheName ( ) , externalCacheFragment ) ; if ( externalCacheFragment != null ) { batchUpdateDaemon . pushExternalCacheFragment ( externalCacheFragment , ServerCache . cache ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "setExternalCacheFragment: {0}" , externalCacheFragment . getUri ( ) ) ; } | This implements the method in the CacheUnit interface . This is called by DRSRemoteService and NullRemoteServices . | 164 | 23 |
160,020 | public void addAlias ( String cacheName , Object id , Object [ ] aliasArray ) { if ( id != null && aliasArray != null ) { DCache cache = ServerCache . getCache ( cacheName ) ; if ( cache != null ) { try { cache . addAlias ( id , aliasArray , false , false ) ; } catch ( IllegalArgumentException e ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Adding alias for cache id " + id + " failure: " + e . getMessage ( ) ) ; } } } } } | This implements the method in the CacheUnit interface . This is called to add alias ids for cache id . | 124 | 22 |
160,021 | public void removeAlias ( String cacheName , Object alias ) { if ( alias != null ) { DCache cache = ServerCache . getCache ( cacheName ) ; if ( cache != null ) { try { cache . removeAlias ( alias , false , false ) ; } catch ( IllegalArgumentException e ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Removing alias " + alias + " failure: " + e . getMessage ( ) ) ; } } } } } | This implements the method in the CacheUnit interface . This is called to remove alias ids from cache id . | 108 | 22 |
160,022 | public CommandCache getCommandCache ( String cacheName ) throws DynamicCacheServiceNotStarted , IllegalStateException { if ( servletCacheUnit == null ) { throw new DynamicCacheServiceNotStarted ( "Servlet cache service has not been started." ) ; } return servletCacheUnit . getCommandCache ( cacheName ) ; } | This implements the method in the CacheUnit interface . This is called to get Command Cache object . | 70 | 19 |
160,023 | public JSPCache getJSPCache ( String cacheName ) throws DynamicCacheServiceNotStarted , IllegalStateException { if ( servletCacheUnit == null ) { throw new DynamicCacheServiceNotStarted ( "Servlet cache service has not been started." ) ; } return servletCacheUnit . getJSPCache ( cacheName ) ; } | This implements the method in the CacheUnit interface . This is called to get JSP Cache object . | 73 | 20 |
160,024 | public Object createObjectCache ( String cacheName ) throws DynamicCacheServiceNotStarted , IllegalStateException { if ( objectCacheUnit == null ) { throw new DynamicCacheServiceNotStarted ( "Object cache service has not been started." ) ; } return objectCacheUnit . createObjectCache ( cacheName ) ; } | This implements the method in the CacheUnit interface . This is called to create object cache . It calls ObjectCacheUnit to perform this operation . | 66 | 28 |
160,025 | public EventSource createEventSource ( boolean createAsyncEventSource , String cacheName ) throws DynamicCacheServiceNotStarted { if ( objectCacheUnit == null ) { throw new DynamicCacheServiceNotStarted ( "Object cache service has not been started." ) ; } return objectCacheUnit . createEventSource ( createAsyncEventSource , cacheName ) ; } | This implements the method in the CacheUnit interface . This is called to create event source object . It calls ObjectCacheUnit to perform this operation . | 74 | 29 |
160,026 | public DERObject toASN1Object ( ) { ASN1EncodableVector dev = new ASN1EncodableVector ( ) ; dev . add ( policyQualifierId ) ; dev . add ( qualifier ) ; return new DERSequence ( dev ) ; } | Returns a DER - encodable representation of this instance . | 60 | 13 |
160,027 | public void sendAckExpectedMessage ( long ackExpStamp , int priority , Reliability reliability , SIBUuid12 stream ) // not used for ptp throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "sendAckExpectedMessage" , new Object [ ] { new Long ( ackExpStamp ) , new Integer ( priority ) , reliability } ) ; if ( routingMEUuid != null ) { ControlAckExpected ackexpMsg ; try { ackexpMsg = cmf . createNewControlAckExpected ( ) ; } catch ( Exception e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.sendAckExpectedMessage" , "1:733:1.241" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendAckExpectedMessage" , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler" , "1:744:1.241" , e } ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler" , "1:752:1.241" , e } , null ) , e ) ; } // As we are using the Guaranteed Header - set all the attributes as // well as the ones we want. SIMPUtils . setGuaranteedDeliveryProperties ( ackexpMsg , messageProcessor . getMessagingEngineUuid ( ) , targetMEUuid , stream , null , destinationHandler . getUuid ( ) , ProtocolType . UNICASTINPUT , GDConfig . PROTOCOL_VERSION ) ; ackexpMsg . setTick ( ackExpStamp ) ; ackexpMsg . setPriority ( priority ) ; ackexpMsg . setReliability ( reliability ) ; // SIB0105 // Update the health state of this stream SourceStream sourceStream = ( SourceStream ) sourceStreamManager . getStreamSet ( ) . getStream ( priority , reliability ) ; if ( sourceStream != null ) { sourceStream . setLatestAckExpected ( ackExpStamp ) ; sourceStream . getControlAdapter ( ) . getHealthState ( ) . updateHealth ( HealthStateListener . ACK_EXPECTED_STATE , HealthState . AMBER ) ; } // If the destination in a Link add Link specific properties to message if ( isLink ) { ackexpMsg = ( ControlAckExpected ) addLinkProps ( ackexpMsg ) ; } // If the destination is system or temporary then the // routingDestination into th message if ( this . isSystemOrTemp ) { ackexpMsg . setRoutingDestination ( routingDestination ) ; } // Send ackExpected message to destination // Using MPIO mpio . sendToMe ( routingMEUuid , priority , ackexpMsg ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Unable to send AckExpected as Link not started" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendAckExpectedMessage" ) ; } | sendAckExpectedMessage is called from SourceStream timer alarm | 853 | 13 |
160,028 | public void sendSilenceMessage ( long startStamp , long endStamp , long completedPrefix , boolean requestedOnly , int priority , Reliability reliability , SIBUuid12 stream ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "sendSilenceMessage" ) ; ControlSilence sMsg ; try { // Create new Silence message sMsg = cmf . createNewControlSilence ( ) ; } catch ( Exception e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.sendSilenceMessage" , "1:849:1.241" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler" , "1:856:1.241" , e } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendSilenceMessage" , e ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.PtoPOutputHandler" , "1:867:1.241" , e } , null ) , e ) ; } // As we are using the Guaranteed Header - set all the attributes as // well as the ones we want. SIMPUtils . setGuaranteedDeliveryProperties ( sMsg , messageProcessor . getMessagingEngineUuid ( ) , targetMEUuid , stream , null , destinationHandler . getUuid ( ) , ProtocolType . UNICASTINPUT , GDConfig . PROTOCOL_VERSION ) ; sMsg . setStartTick ( startStamp ) ; sMsg . setEndTick ( endStamp ) ; sMsg . setPriority ( priority ) ; sMsg . setReliability ( reliability ) ; sMsg . setCompletedPrefix ( completedPrefix ) ; // If the destination in a Link add Link specific properties to message if ( isLink ) { sMsg = ( ControlSilence ) addLinkProps ( sMsg ) ; } // If the destination is system or temporary then the // routingDestination into th message if ( this . isSystemOrTemp ) { sMsg . setRoutingDestination ( routingDestination ) ; } // Send message to destination // Using MPIO // If requestedOnly then this is a response to a Nack so resend at priority+1 if ( requestedOnly ) mpio . sendToMe ( routingMEUuid , priority + 1 , sMsg ) ; else mpio . sendToMe ( routingMEUuid , priority , sMsg ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendSilenceMessage" ) ; } | sendSilenceMessage may be called from SourceStream when a Nack is recevied | 711 | 18 |
160,029 | protected void handleRollback ( LocalTransaction transaction ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "handleRollback" , transaction ) ; // Roll back the transaction if we created it. if ( transaction != null ) { try { transaction . rollback ( ) ; } catch ( SIException e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.PtoPOutputHandler.handleRollback" , "1:1644:1.241" , this ) ; SibTr . exception ( tc , e ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "handleRollback" ) ; } | This method checks to see if rollback is required | 185 | 10 |
160,030 | public void updateTargetCellule ( SIBUuid8 targetMEUuid ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "updateTargetCellule" , targetMEUuid ) ; this . targetMEUuid = targetMEUuid ; sourceStreamManager . updateTargetCellule ( targetMEUuid ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "updateTargetCellule" ) ; } | This method should only be called when the PtoPOutputHandler was created for a Link with an unknown targetCellule and WLM has now told us correct targetCellule . | 131 | 36 |
160,031 | public void updateRoutingCellule ( SIBUuid8 routingME ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "updateRoutingCellule" , routingME ) ; this . routingMEUuid = routingME ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "updateRoutingCellule" ) ; } | This method should only be called when the PtoPOutputHandler was created for a Link . It is called every time a message is sent | 107 | 28 |
160,032 | public void enqueueWork ( AsyncUpdate unit ) throws ClosedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "enqueueWork" , unit ) ; synchronized ( this ) { if ( closed ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "enqueueWork" , "ClosedException" ) ; throw new ClosedException ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Enqueueing update: " + unit ) ; enqueuedUnits . add ( unit ) ; if ( executing ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "enqueueWork" , "AsyncUpdateThread executing" ) ; return ; } // not executing enqueued updates if ( enqueuedUnits . size ( ) > batchThreshold ) { executeSinceExpiry = true ; try { startExecutingUpdates ( ) ; } catch ( ClosedException e ) { // No FFDC code needed if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "enqueueWork" , e ) ; throw e ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "enqueueWork" ) ; } | Enqueue an AsyncUpdate | 352 | 6 |
160,033 | private void startExecutingUpdates ( ) throws ClosedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "startExecutingUpdates" ) ; // swap the enqueuedUnits and executingUnits. ArrayList temp = executingUnits ; executingUnits = enqueuedUnits ; enqueuedUnits = temp ; enqueuedUnits . clear ( ) ; // enqueuedUnits is now ready to accept AsyncUpdates in enqueueWork() executing = true ; try { LocalTransaction tran = tranManager . createLocalTransaction ( false ) ; ExecutionThread thread = new ExecutionThread ( executingUnits , tran ) ; mp . startNewSystemThread ( thread ) ; } catch ( InterruptedException e ) { // this object cannot recover from this exception since we don't know how much work the ExecutionThread // has done. should not occur! FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.store.AsyncUpdateThread.startExecutingUpdates" , "1:222:1.28" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "startExecutingUpdates" , e ) ; closed = true ; throw new ClosedException ( e . getMessage ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "startExecutingUpdates" ) ; } | Internal method . Should be called from within a synchronized block . | 362 | 12 |
160,034 | public void alarm ( Object thandle ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "alarm" , new Object [ ] { this , mp . getMessagingEngineUuid ( ) } ) ; synchronized ( this ) { if ( ! closed ) { if ( ( executeSinceExpiry ) || executing ) { // has committed recently executeSinceExpiry = false ; } else { // has not committed recently try { if ( enqueuedUnits . size ( ) > 0 ) startExecutingUpdates ( ) ; } catch ( ClosedException e ) { // No FFDC code needed // do nothing as error already logged by startExecutingUpdates } } } } // end synchronized (this) if ( maxCommitInterval > 0 ) { mp . getAlarmManager ( ) . create ( maxCommitInterval , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "alarm" ) ; } | end class ExecutionThread ... | 237 | 5 |
160,035 | public void waitTillAllUpdatesExecuted ( ) throws InterruptedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "waitTillAllUpdatesExecuted" ) ; synchronized ( this ) { while ( enqueuedUnits . size ( ) > 0 || executing ) { try { this . wait ( ) ; } catch ( InterruptedException e ) { // No FFDC code needed if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "waitTillAllUpdatesExecuted" , e ) ; throw e ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "waitTillAllUpdatesExecuted" ) ; } | This method blocks till there are 0 enqueued updates and 0 executing updates . Useful for unit testing . | 194 | 21 |
160,036 | public Throwable getRootCause ( ) { Throwable root = getError ( ) ; while ( true ) { if ( root instanceof ServletException ) { ServletException se = ( ServletException ) _error ; Throwable seRoot = se . getRootCause ( ) ; if ( seRoot == null ) { return root ; } else if ( seRoot . equals ( root ) ) { //prevent possible recursion return root ; } else { root = seRoot ; } } else { return root ; } } } | Get the original cause of the error . Use of ServletExceptions by the engine to rethrow errors can cause the original error to be buried within one or more exceptions . This method will sift through the wrapped ServletExceptions to return the original error . | 110 | 53 |
160,037 | protected void activate ( ComponentContext context ) { securityServiceRef . activate ( context ) ; unauthSubjectServiceRef . activate ( context ) ; authServiceRef . activate ( context ) ; credServiceRef . activate ( context ) ; } | Called during service activation . | 48 | 6 |
160,038 | protected void initialise ( String logFileName , int logFileType , java . util . Map objectStoreLocations , ObjectManagerEventCallback [ ] callbacks ) throws ObjectManagerException { final String methodName = "initialise" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { logFileName , new Integer ( logFileType ) , objectStoreLocations , callbacks } ) ; if ( objectStoreLocations == null ) objectStoreLocations = new java . util . HashMap ( ) ; // Repeat attempts to find or create an ObjectManagerState. for ( ; ; ) { // Look for existing ObjectManagerState. synchronized ( objectManagerStates ) { objectManagerState = ( ObjectManagerState ) objectManagerStates . get ( logFileName ) ; if ( objectManagerState == null ) { // None known, so make one. objectManagerState = createObjectManagerState ( logFileName , logFileType , objectStoreLocations , callbacks ) ; objectManagerStates . put ( logFileName , objectManagerState ) ; } } // synchronized (objectManagerStates). synchronized ( objectManagerState ) { if ( objectManagerState . state == ObjectManagerState . stateColdStarted || objectManagerState . state == ObjectManagerState . stateWarmStarted ) { // We are ready to go. break ; } else { // Wait for the ObjectManager state to become usable or terminate. try { objectManagerState . wait ( ) ; // Let some other thread initialise the ObjectManager . } catch ( InterruptedException exception ) { // No FFDC Code Needed. ObjectManager . ffdc . processException ( cclass , methodName , exception , "1:260:1.28" ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , exception ) ; throw new UnexpectedExceptionException ( this , exception ) ; } // catch (InterruptedException exception). } // if (objectManagerState.state... } // synchronized (objectManagerState) } // for (;;). if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName ) ; } | Create a handle for the ObjectManagerState and initialise it of necessary . | 502 | 15 |
160,039 | protected ObjectManagerState createObjectManagerState ( String logFileName , int logFileType , java . util . Map objectStoreLocations , ObjectManagerEventCallback [ ] callbacks ) throws ObjectManagerException { return new ObjectManagerState ( logFileName , this , logFileType , objectStoreLocations , callbacks ) ; } | Instantiate the ObjectManagerState . A subclass of ObjectManager should override this method if a subclass of ObjecManagerState is required . | 69 | 27 |
160,040 | public final boolean warmStarted ( ) { final String methodName = "warmStarted" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName ) ; boolean isWarmStarted = false ; if ( objectManagerState . state == ObjectManagerState . stateWarmStarted ) isWarmStarted = true ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , new Boolean ( isWarmStarted ) ) ; return isWarmStarted ; } | returns true if the objectManager was warm started . | 141 | 11 |
160,041 | public final void shutdown ( ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "shutdown" ) ; objectManagerState . shutdown ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "shutdown" ) ; } | Terminates the ObjectManager . | 92 | 6 |
160,042 | public final void shutdownFast ( ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "shutdownFast" ) ; if ( ! testInterfaces ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "shutdownFast" , "via InterfaceDisabledException" ) ; throw new InterfaceDisabledException ( this , "shutdownFast" ) ; } // if (!testInterfaces). objectManagerState . shutdownFast ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "shutdownFast" ) ; } | Terminates the ObjectManager without taking a checkpoint . The allows the ObjectManager to be restarted as if it had crashed and is only intended for testing emergency restart . | 173 | 33 |
160,043 | public final void waitForCheckpoint ( ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "waitForCheckpoint" ) ; if ( ! testInterfaces ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "waitForCheckpoint via InterfaceDisabledException" ) ; throw new InterfaceDisabledException ( this , "waitForCheckpoint" ) ; } // if (!testInterfaces). objectManagerState . waitForCheckpoint ( true ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "waitForCheckpoint" ) ; } | Waits for one checkpoint to complete . | 179 | 8 |
160,044 | public final Transaction getTransaction ( ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "getTransaction" ) ; // If the log is full introduce a delay for a checkpoiunt before allowing the // application to proceed. objectManagerState . transactionPacing ( ) ; Transaction transaction = objectManagerState . getTransaction ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "getTransaction" , "returns transaction=" + transaction + "(Transaction)" ) ; return transaction ; } | Factory method to crate a new transaction for use with the ObjectManager . | 145 | 14 |
160,045 | public final Transaction getTransactionByXID ( byte [ ] XID ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "getTransactionByXID" , "XIDe=" + XID + "(byte[]" ) ; Transaction transaction = objectManagerState . getTransactionByXID ( XID ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "getTransactionByXID" , "returns transaction=" + transaction + "(Transaction)" ) ; return transaction ; } | Locate a transaction registered with this ObjectManager . with the same XID as the one passed . If a null XID is passed this will return any registered transaction with a null XID . | 145 | 39 |
160,046 | public final java . util . Iterator getTransactionIterator ( ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "getTransactionIterator" ) ; java . util . Iterator transactionIterator = objectManagerState . getTransactionIterator ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "getTransactionIterator" , "returns transactionIterator" + transactionIterator + "(java.util.Iterator)" ) ; return transactionIterator ; } | Create an iterator over all transactions known to this ObjectManager . The iterator returned is safe against concurrent modification of the set of transactions new transactions created after the iterator is created may not be covered by the iterator . | 134 | 41 |
160,047 | public final ObjectStore getObjectStore ( String objectStoreName ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "getObjectStore" , "objectStoreName=" + objectStoreName + "(String)" ) ; ObjectStore objectStore = objectManagerState . getObjectStore ( objectStoreName ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "getObjectStore" , "returns objectStore=" + objectStore + "(ObjectStore)" ) ; return objectStore ; } | Locate an ObjectStore used by this objectManager . | 144 | 11 |
160,048 | public final java . util . Iterator getObjectStoreIterator ( ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "getObjectStoreIterator" ) ; java . util . Iterator objectStoreIterator = objectManagerState . getObjectStoreIterator ( ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "getObjectStoreIterator" , new Object [ ] { objectStoreIterator } ) ; return objectStoreIterator ; } | Create an iterator over all ObjectStores known to this ObjectManager . | 132 | 14 |
160,049 | public final Token getNamedObject ( String name , Transaction transaction ) throws ObjectManagerException { final String methodName = "getNamedObject" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { name , transaction } ) ; // Is the definitive tree assigned? if ( objectManagerState . namedObjects == null ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , "via NoRestartableObjectStoresAvailableException" ) ; throw new NoRestartableObjectStoresAvailableException ( this ) ; } // if (objectManagerState.namedObjects == null). TreeMap namedObjectsTree = ( TreeMap ) objectManagerState . namedObjects . getManagedObject ( ) ; Token token = ( Token ) namedObjectsTree . get ( name , transaction ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , new Object [ ] { token } ) ; return token ; } | Locate a Token by name within this objectManager . | 261 | 11 |
160,050 | public final Token removeNamedObject ( String name , Transaction transaction ) throws ObjectManagerException { final String methodName = "removeNamedObject" ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , methodName , new Object [ ] { name , transaction } ) ; Token tokenOut = null ; // For return. // See if there is a definitive namedObjdects tree. if ( objectManagerState . namedObjects == null ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , "via NoRestartablebjectStoresAvailableException" ) ; throw new NoRestartableObjectStoresAvailableException ( this ) ; } // if (objectManagerState.namedObjects == null). // Loop over all of the ObjectStores. java . util . Iterator objectStoreIterator = objectManagerState . objectStores . values ( ) . iterator ( ) ; while ( objectStoreIterator . hasNext ( ) ) { ObjectStore objectStore = ( ObjectStore ) objectStoreIterator . next ( ) ; // Don't bother with ObjectStores that can't be used for recovery. if ( objectStore . getContainsRestartData ( ) ) { // Locate any existing copy. Token namedObjectsToken = new Token ( objectStore , ObjectStore . namedObjectTreeIdentifier . longValue ( ) ) ; // Swap for the definitive Token, if there is one. namedObjectsToken = objectStore . like ( namedObjectsToken ) ; TreeMap namedObjectsTree = ( TreeMap ) namedObjectsToken . getManagedObject ( ) ; tokenOut = ( Token ) namedObjectsTree . remove ( name , transaction ) ; } // if (objectStore.getContainsRestartData()). } // While objectStoreIterator.hasNext(). if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , methodName , new Object [ ] { tokenOut } ) ; return tokenOut ; } | Remove a named ManagedObject locatable by name within this objectManager . | 461 | 15 |
160,051 | public final void setTransactionsPerCheckpoint ( long persistentTransactionsPerCheckpoint , long nonPersistentTransactionsPerCheckpoint , Transaction transaction ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "setTransactionsPerCheckpoint" , new Object [ ] { new Long ( persistentTransactionsPerCheckpoint ) , new Long ( nonPersistentTransactionsPerCheckpoint ) , transaction } ) ; transaction . lock ( objectManagerState ) ; objectManagerState . persistentTransactionsPerCheckpoint = persistentTransactionsPerCheckpoint ; objectManagerState . nonPersistentTransactionsPerCheckpoint = nonPersistentTransactionsPerCheckpoint ; // saveClonedState does not update the defaultStore. transaction . replace ( objectManagerState ) ; // Save the updates in the restartable ObjectStores. objectManagerState . saveClonedState ( transaction ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "setTransactionsPerCheckpoint" ) ; } | Create a named ManagedObject by name within this objectManager . | 243 | 13 |
160,052 | public final void setMaximumActiveTransactions ( int maximumActiveTransactions , Transaction transaction ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "setMaximumActiveTransactions" , new Object [ ] { new Integer ( maximumActiveTransactions ) , transaction } ) ; transaction . lock ( objectManagerState ) ; objectManagerState . maximumActiveTransactions = maximumActiveTransactions ; // saveClonedState does not update the defaultStore. transaction . replace ( objectManagerState ) ; // Save the updates in the restartable ObjectStores. objectManagerState . saveClonedState ( transaction ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "setMaximumActiveTransactions" ) ; } | Change the maximum active transactrions that the ObjectManager will allow to start . If this call reduces the maximum then existing transactions continue but no new ones are allowed until the total has fallen below the new maximum . | 187 | 42 |
160,053 | public java . util . Map captureStatistics ( String name ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "captureStatistics" , new Object [ ] { name } ) ; java . util . Map statistics = new java . util . HashMap ( ) ; // To be returned. synchronized ( objectManagerState ) { if ( ! ( objectManagerState . state == ObjectManagerState . stateColdStarted ) && ! ( objectManagerState . state == ObjectManagerState . stateWarmStarted ) ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "addEntry" , new Object [ ] { new Integer ( objectManagerState . state ) , ObjectManagerState . stateNames [ objectManagerState . state ] } ) ; throw new InvalidStateException ( this , objectManagerState . state , ObjectManagerState . stateNames [ objectManagerState . state ] ) ; } if ( name . equals ( "*" ) ) { statistics . putAll ( objectManagerState . logOutput . captureStatistics ( ) ) ; statistics . putAll ( captureStatistics ( ) ) ; } else if ( name . equals ( "LogOutput" ) ) { statistics . putAll ( objectManagerState . logOutput . captureStatistics ( ) ) ; } else if ( name . equals ( "ObjectManager" ) ) { statistics . putAll ( captureStatistics ( ) ) ; } else { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "captureStatistics" , new Object [ ] { name } ) ; throw new StatisticsNameNotFoundException ( this , name ) ; } // if (name.equals... } // synchronized (objectManagerState). if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "captureStatistics" , statistics ) ; return statistics ; } | Capture statistics . | 448 | 3 |
160,054 | public void registerEventCallback ( ObjectManagerEventCallback callback ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "registerEventCallback" , callback ) ; objectManagerState . registerEventCallback ( callback ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "registerEventCallback" ) ; } | Defect 495856 496893 | 101 | 8 |
160,055 | 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 . | 93 | 28 |
160,056 | 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 . | 134 | 28 |
160,057 | 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 | 77 | 16 |
160,058 | 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 | 95 | 4 |
160,059 | 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 | 93 | 4 |
160,060 | 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 . | 104 | 15 |
160,061 | 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 | 280 | 6 |
160,062 | public < T > T create ( Class < T > cls , Object ... varValues ) { return cls . cast ( createWithValues ( varValues ) ) ; } | Creates a proxy | 36 | 4 |
160,063 | 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 . | 225 | 9 |
160,064 | public static final String getMessage ( String key , Object ... args ) { return NLS . getFormattedMessage ( key , args , key ) ; } | Get a translated message from J2CAMessages file . | 32 | 13 |
160,065 | 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 . | 131 | 14 |
160,066 | public static String getSessionID ( HttpServletRequest req ) { String sessionID = null ; final HttpServletRequest f_req = req ; try { sessionID = AccessController . doPrivileged ( new PrivilegedExceptionAction < String > ( ) { @ Override 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 > ( ) { @ Override public String run ( ) { return f_req . getSession ( ) . getId ( ) ; } } ) ; } else { sessionID = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { @ Override 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 > ( ) { @ Override public String run ( ) { return f_req . getSession ( ) . getId ( ) ; } } ) ; } else { sessionID = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { @ Override 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 . | 480 | 16 |
160,067 | 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 | 65 | 11 |
160,068 | 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 | 62 | 11 |
160,069 | @ Override public Object get ( ) { Object oObject = null ; synchronized ( this ) { // Check if any are free in the free hashtable if ( lastEntry > - 1 ) { // Free array has entries, get the last one. // remove last one for best performance oObject = free [ lastEntry ] ; free [ lastEntry ] = null ; if ( lastEntry == firstEntry ) { // none left in pool lastEntry = - 1 ; firstEntry = - 1 ; } else if ( lastEntry > 0 ) { lastEntry = lastEntry - 1 ; } else { // last entry = 0, reset to end of list 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 . | 171 | 28 |
160,070 | @ Override public Object put ( Object object ) { Object returnVal = null ; long currentTime = CHFWBundle . getApproxTime ( ) ; synchronized ( this ) { // get next free position, or oldest position if none free lastEntry ++ ; // If last entry is past end of array, go back to the beginning if ( lastEntry == poolSize ) { lastEntry = 0 ; } returnVal = free [ lastEntry ] ; // get whatever was in that slot for return // value free [ lastEntry ] = object ; timeFreed [ lastEntry ] = currentTime ; // if we overlaid the first/oldest entry, reset the first entry position if ( lastEntry == firstEntry ) { firstEntry ++ ; if ( firstEntry == poolSize ) { firstEntry = 0 ; } } if ( firstEntry == - 1 ) { // if pool was empty before, this is first entry now firstEntry = lastEntry ; // should always be at '0', this may // overwrite the oldest entry, in which case // the oldest one will be garbage collected } if ( returnVal != null && destroyer != null ) { // @PK36998A destroyer . destroy ( returnVal ) ; } // check timestamp of oldest entry, and delete if older than 60 seconds // we should do a batch cleanup of all pools based on a timer rather than // waiting for a buffer to be released to trigger it, maybe in the next // release if ( cleanUpOld ) { while ( firstEntry != lastEntry ) { if ( currentTime > ( timeFreed [ firstEntry ] + 60000L ) ) { if ( destroyer != null && free [ firstEntry ] != null ) { // @PK36998A 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 . | 407 | 27 |
160,071 | 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 . | 58 | 29 |
160,072 | 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 ) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed 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 . | 180 | 20 |
160,073 | 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 ) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed 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 . | 186 | 18 |
160,074 | 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 ) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed 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 . | 186 | 17 |
160,075 | 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 ) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed 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 . | 186 | 17 |
160,076 | 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 ) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed 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 . | 186 | 17 |
160,077 | 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 ) { /* No need to FFDC this as JsMsgObject will already have done so */ // No FFDC code needed 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 . | 186 | 17 |
160,078 | 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 . | 143 | 24 |
160,079 | @ Override public VirtualConnection read ( long numBytes , TCPReadCompletedCallback userCallback , boolean forceQueue , int timeout ) { // Call the async read with a flag showing this was not done from a queued request. 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 . | 65 | 44 |
160,080 | private void handleAsyncComplete ( boolean forceQueue , TCPReadCompletedCallback inCallback ) { boolean fireHere = true ; if ( forceQueue ) { // Complete must be returned on a separate thread. // Reuse queuedWork object (performance), but reset the error parameters. 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 ) ; // fall-thru below and use callback here regardless } else { // fire an event to continue this queued work Event event = events . createEvent ( SSLEventHandler . TOPIC_QUEUED_WORK ) ; event . setProperty ( SSLEventHandler . KEY_RUNNABLE , this . queuedWork ) ; events . postEvent ( event ) ; fireHere = false ; } } if ( fireHere ) { // Call the callback right here. 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 . | 265 | 53 |
160,081 | private void handleAsyncError ( boolean forceQueue , IOException exception , TCPReadCompletedCallback inCallback ) { boolean fireHere = true ; if ( forceQueue ) { // Error must be returned on a separate thread. // Reuse queuedWork object (performance), but reset the error parameters. 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 ) ; // fall-thru below and use callback here regardless } else { // fire an event to continue this queued work Event event = events . createEvent ( SSLEventHandler . TOPIC_QUEUED_WORK ) ; event . setProperty ( SSLEventHandler . KEY_RUNNABLE , this . queuedWork ) ; events . postEvent ( event ) ; fireHere = false ; } } if ( fireHere ) { // Call the callback right here. 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 . | 273 | 51 |
160,082 | public long readUnconsumedDecData ( ) { long totalBytesRead = 0L ; // Determine if data is left over from a former read request. if ( unconsumedDecData != null ) { // Left over data exists. Is there enough to satisfy the request? if ( getBuffer ( ) == null ) { // Caller needs us to allocate the buffer to return. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Caller needs buffer, unconsumed data: " + SSLUtils . getBufferTraceInfo ( unconsumedDecData ) ) ; } // Note, data of unconsumedDecData buffer array should be starting // at position 0 in the first buffer. totalBytesRead = SSLUtils . lengthOf ( unconsumedDecData , 0 ) ; // First release any existing buffers in decryptedNetBuffers array. cleanupDecBuffers ( ) ; callerRequiredAllocation = true ; // Note, it is the responsibility of the calling channel to release this buffer. decryptedNetBuffers = unconsumedDecData ; // Set left over buffers to null to note that they are no longer in use. unconsumedDecData = null ; if ( ( decryptedNetLimitInfo == null ) || ( decryptedNetLimitInfo . length != decryptedNetBuffers . length ) ) { decryptedNetLimitInfo = new int [ decryptedNetBuffers . length ] ; } SSLUtils . getBufferLimits ( decryptedNetBuffers , decryptedNetLimitInfo ) ; } else { // Caller provided buffers for read. We need to copy the left over // data to those buffers. if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Caller provided buffers, unconsumed data: " + SSLUtils . getBufferTraceInfo ( unconsumedDecData ) ) ; } // First release any existing buffers in decryptedNetBuffers array. cleanupDecBuffers ( ) ; // The unconsumedDecData buffers have the data to copy to the user buffers. // The copyDataToCallerBuffers method copies from decryptedNetBuffers, so assign it. decryptedNetBuffers = unconsumedDecData ; // Copy the outputbuffer to the buffers provided by the caller. totalBytesRead = copyDataToCallerBuffers ( ) ; // Null out the reference to the overflow buffers. 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 . | 534 | 37 |
160,083 | protected void getNetworkBuffer ( long requestedSize ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "getNetworkBuffer: size=" + requestedSize ) ; } // Reset the netBuffer mark. this . netBufferMark = 0 ; int allocationSize = getConnLink ( ) . getPacketBufferSize ( ) ; if ( allocationSize < requestedSize ) { allocationSize = ( int ) requestedSize ; } if ( null == this . netBuffer ) { // Need to allocate a buffer to give to the device channel to read into. 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 ) { // 431269 - nothing is currently in this buffer, see if we can reuse it if ( cap >= allocationSize ) { this . netBuffer . clear ( ) ; } else { this . netBuffer . release ( ) ; this . netBuffer = SSLUtils . allocateByteBuffer ( allocationSize , true ) ; } } else { // if we have less than the allocation size amount of data + empty, // then make a new buffer to start clean inside of... if ( ( cap - pos ) < allocationSize ) { // allocate a new buffer, copy the existing data over 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 ) ; } } } // Inform the device side channel to read into the new buffers. 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 . | 565 | 56 |
160,084 | private void cleanupDecBuffers ( ) { // if we have decrypted buffers and they are either JIT created or made // during decryption/expansion (user buffers too small) then release them // here and dereference 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 . | 105 | 22 |
160,085 | 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 | 287 | 7 |
160,086 | private SSLEngineResult doHandshake ( boolean async ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "doHandshake" ) ; } SSLEngineResult sslResult ; // Line up all the buffers needed for the SSL handshake. Temporary so // use indirect allocation for speed. 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 ) ; // Callback to be used if the request is async. MyHandshakeCompletedCallback handshakeCallback = null ; if ( async ) { handshakeCallback = new MyHandshakeCompletedCallback ( this , callback , localNetBuffer , decryptedNetBuffer , encryptedAppBuffer ) ; } try { // Do the SSL handshake. Note, if synchronous the handshakeCallback is null. sslResult = SSLUtils . handleHandshake ( getConnLink ( ) , localNetBuffer , decryptedNetBuffer , encryptedAppBuffer , null , handshakeCallback , false ) ; } catch ( IOException e ) { // Release buffers used in the handshake. localNetBuffer . release ( ) ; localNetBuffer = null ; decryptedNetBuffer . release ( ) ; decryptedNetBuffer = null ; encryptedAppBuffer . release ( ) ; encryptedAppBuffer = null ; throw e ; } if ( sslResult != null ) { // Handshake was done synchronously. // Release buffers used in the handshake. 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 . | 475 | 37 |
160,087 | protected ContextualStorage getContextualStorage ( boolean createIfNotExist , String clientWindowFlowId ) { //FacesContext facesContext = FacesContext.getCurrentInstance(); //String clientWindowFlowId = getCurrentClientWindowFlowId(facesContext); 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 . | 152 | 17 |
160,088 | protected void proxyReadHandshake ( ) { // setup the read buffer - use JIT on the first read attempt. If it // works, then any subsequent reads will use that same buffer. connLink . getReadInterface ( ) . setJITAllocateSize ( 1024 ) ; // reader.setBuffer(WsByteBufferPoolManagerImpl.getRef().allocate(1024)); if ( connLink . isAsyncConnect ( ) ) { // handshake - read the proxy response 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 (null == this.syncError) { if ( connLink . isSyncError ( ) == false ) { // create a new connect exception connLink . connectFailed ( new IOException ( "Invalid Proxy Server Response " ) ) ; } } } } | Complete the proxy connect handshake by reading for the response and validating any data . | 296 | 16 |
160,089 | protected int checkResponse ( TCPReadRequestContext rsc ) { // Parse the proxy server response // WsByteBuffer [ ] buffers = rsc . getBuffers ( ) ; // check if the correct response was received 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 . | 135 | 7 |
160,090 | 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 . | 100 | 7 |
160,091 | 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 . | 100 | 7 |
160,092 | protected boolean containsHTTP200 ( byte [ ] data ) { boolean rc = true ; // byte comparison to check for HTTP and 200 in the response // this code is not pretty, it is designed to be fast // code assumes that HTTP/1.0 200 will be contained in one buffer // if ( data . length < 12 || data [ 0 ] != ' ' || data [ 1 ] != ' ' || data [ 2 ] != ' ' || data [ 3 ] != ' ' || data [ 9 ] != ' ' || data [ 10 ] != ' ' || data [ 11 ] != ' ' ) { 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 . | 173 | 14 |
160,093 | protected void readProxyResponse ( VirtualConnection inVC ) { int size = 1 ; if ( ! this . isProxyResponseValid ) { // we need at least 12 bytes for the first line 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 ) { // no FFDC required 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 . | 236 | 23 |
160,094 | public synchronized void setDefaultDestLimits ( ) throws MessageStoreException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setDefaultDestLimits" ) ; // Defaults are based on those defined to the ME, the low is 80% of the high // Use setDestLimits() to set the initial limits/watermarks (510343) 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 | 169 | 8 |
160,095 | 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 . | 87 | 14 |
160,096 | 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 . | 87 | 14 |
160,097 | 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 ) } ) ; // Retrieve appropriate information String destinationName = destinationHandler . getName ( ) ; String meName = mp . getMessagingEngineName ( ) ; // If we've been told to output the event message to the log, do it... 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 we're actually issuing events, do that too... if ( _isEventNotificationEnabled ) { if ( cAdapter != null ) { // Build the message for the Notification 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 ) ; // Build the properties for the Notification 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 ) ; // Number of Messages props . put ( SibNotificationConstants . KEY_MESSAGES , String . valueOf ( numMsgs ) ) ; // Now create the Event object to pass to the control adapter MPRuntimeEvent MPevent = new MPRuntimeEvent ( SibNotificationConstants . TYPE_SIB_MESSAGEPOINT_DEPTH_THRESHOLD_REACHED , message , props ) ; // Fire the event 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 | 864 | 29 |
160,098 | private void reschedule ( ) { // set up a daily roll Calendar cal = Calendar . getInstance ( ) ; long today = cal . getTimeInMillis ( ) ; // adjust to somewhere after midnight of the next day 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 . | 135 | 14 |
160,099 | @ Override public void run ( ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) // F743-425.CodRev Tr . entry ( tc , "run: " + ivTimer . ivTaskId ) ; // F743-425.CodRev if ( serverStopping ) { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "Server shutting down; aborting" ) ; return ; } if ( ivRetries == 0 ) // This is the first try { // F743-7591 - Calculate the next expiration before calling the timeout // method. This ensures that Timer.getNextTimeout will properly throw // NoMoreTimeoutsException. ivTimer . calculateNextExpiration ( ) ; } // Log a warning if this timer is starting late ivTimer . checkLateTimerThreshold ( ) ; try // F743-425.CodRev { // Call the timeout method; last chance effort to abort if cancelled if ( ! ivTimer . isIvDestroyed ( ) ) { doWork ( ) ; } else { if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "Timer has been cancelled; aborting" ) ; return ; } ivRetries = 0 ; // re-schedule the alarm to go off again if it needs to, // and if timer had not been canceled ivTimer . scheduleNext ( ) ; // RTC107334 } catch ( Throwable ex ) // F743-425.CodRev { // Do not FFDC... that has already been done when the method failed // All exceptions from timeout methods are system exceptions... // indicating the timeout method failed, and should be retried. d667153 if ( isTraceOn && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "NP Timer failed : " + ex . getClass ( ) . getName ( ) + ":" + ex . getMessage ( ) , ex ) ; } if ( ( ivRetryLimit != - 1 ) && // not configured to retry indefinitely ( ivRetries >= ivRetryLimit ) ) // and retry limit reached { // Note: ivRetryLimit==0 means no retries at all 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 ++ ; // begin 597753 if ( ivRetries == 1 ) { // do first retry immediately, by re-entering this method run ( ) ; } else { // re-schedule the alarm to go off after the retry interval // (if timer had not been canceled) ivTimer . scheduleRetry ( ivRetryInterval ) ; // RTC107334 } } if ( isTraceOn && tc . isEntryEnabled ( ) ) // F743-425.CodRev Tr . exit ( tc , "run" ) ; // F743-425.CodRev } | Executes the timer work with configured retries . | 725 | 10 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.