idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
36,500
public EJSWrapperBase getLocalBusinessWrapperBase ( int interfaceIndex ) { if ( interfaceIndex == 0 && ivBMD . ivLocalBean ) { return getLocalBeanWrapperBase ( ( LocalBeanWrapper ) ivBusinessLocal [ 0 ] ) ; } return ( EJSWrapperBase ) ivBusinessLocal [ 0 ] ; }
Method to get the local business wrapper base .
36,501
public Object getRemoteBusinessObject ( int interfaceIndex ) throws RemoteException { Class < ? > [ ] bInterfaceClasses = ivBMD . ivBusinessRemoteInterfaceClasses ; BusinessRemoteWrapper wrapper = ivBusinessRemote [ interfaceIndex ] ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getRemoteBusinessObject : " + wrapper . getClass ( ) . getName ( ) ) ; registerServant ( wrapper , interfaceIndex ) ; ClassLoader moduleContextClassLoader = ivBMD . ivContextClassLoader ; Object result = getRemoteBusinessReference ( wrapper , moduleContextClassLoader , bInterfaceClasses [ interfaceIndex ] ) ; return result ; }
Method to get the remote business object given the index of the interface .
36,502
public BusinessRemoteWrapper getRemoteBusinessWrapper ( WrapperId wrapperId ) { int remoteIndex = wrapperId . ivInterfaceIndex ; BusinessRemoteWrapper wrapper = null ; String wrapperInterfaceName = "" ; if ( remoteIndex < ivBusinessRemote . length ) { wrapper = ivBusinessRemote [ remoteIndex ] ; wrapperInterfaceName = ivBMD . ivBusinessRemoteInterfaceClasses [ remoteIndex ] . getName ( ) ; } String interfaceName = wrapperId . ivInterfaceClassName ; if ( ( wrapper == null ) || ( ! wrapperInterfaceName . equals ( interfaceName ) ) ) { wrapper = null ; for ( int i = 0 ; i < ivBusinessRemote . length ; ++ i ) { wrapperInterfaceName = ivBMD . ivBusinessRemoteInterfaceClasses [ i ] . getName ( ) ; if ( wrapperInterfaceName . equals ( interfaceName ) ) { remoteIndex = i ; wrapper = ivBusinessRemote [ remoteIndex ] ; wrapperId . ivInterfaceIndex = remoteIndex ; break ; } } if ( wrapper == null ) { throw new IllegalStateException ( "Remote " + interfaceName + " interface not defined" ) ; } } registerServant ( wrapper , remoteIndex ) ; return wrapper ; }
d419704 - rewrote for new WrapperId fields and remove the todo .
36,503
private String getAliasToFinalize ( CMConfigData cmConfigData ) { String alias = null ; if ( cmConfigData == null ) return alias ; final String DEFAULT_PRINCIPAL_MAPPING = "DefaultPrincipalMapping" ; final String MAPPING_ALIAS = "com.ibm.mapping.authDataAlias" ; String loginConfigurationName = cmConfigData . getLoginConfigurationName ( ) ; if ( ( loginConfigurationName != null ) && ( ! loginConfigurationName . equals ( "" ) ) ) { if ( loginConfigurationName . equals ( DEFAULT_PRINCIPAL_MAPPING ) ) { HashMap loginConfigProps = cmConfigData . getLoginConfigProperties ( ) ; if ( ( loginConfigProps != null ) && ( ! loginConfigProps . isEmpty ( ) ) ) { alias = ( String ) loginConfigProps . get ( MAPPING_ALIAS ) ; } } } if ( alias == null ) { alias = cmConfigData . getContainerAlias ( ) ; } return alias ; }
Get the jaas alias from the config .
36,504
private Set getPrivateGenericCredentials ( final Subject subj ) throws ResourceException { Set privateGenericCredentials = null ; if ( System . getSecurityManager ( ) != null ) { try { privateGenericCredentials = ( Set ) AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { public Object run ( ) throws Exception { return subj . getPrivateCredentials ( GenericCredential . class ) ; } } ) ; } catch ( PrivilegedActionException pae ) { FFDCFilter . processException ( pae , "com.ibm.ejs.j2c.ThreadIdentitySecurityHelper.beforeGettingConnection" , "18" , this ) ; Tr . error ( tc , "FAILED_DOPRIVILEGED_J2CA0060" , pae ) ; Exception e = pae . getException ( ) ; ResourceException re = new ResourceException ( "ThreadIdentitySecurityHelper failed attempting to access Subject's credentials" ) ; re . initCause ( e ) ; throw re ; } } else { privateGenericCredentials = subj . getPrivateCredentials ( GenericCredential . class ) ; } return privateGenericCredentials ; }
Return the set of private credentials of type GenericCredential from the given subject .
36,505
private Object setJ2CThreadIdentity ( final Subject subj ) throws ResourceException { Object retObject = null ; try { if ( System . getSecurityManager ( ) != null ) { retObject = AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { public Object run ( ) throws Exception { return ThreadIdentityManager . setJ2CThreadIdentity ( subj ) ; } } ) ; } else { retObject = ThreadIdentityManager . setJ2CThreadIdentity ( subj ) ; } } catch ( PrivilegedActionException pae ) { FFDCFilter . processException ( pae , "com.ibm.ejs.j2c.ThreadIdentitySecurityHelper.beforeGettingConnection" , "11" , this ) ; Tr . error ( tc , "FAILED_DOPRIVILEGED_J2CA0060" , pae ) ; Exception e = pae . getException ( ) ; ResourceException re = new ResourceException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() failed attempting to push the current user identity to the OS Thread" ) ; re . initCause ( e ) ; throw re ; } catch ( IllegalStateException ise ) { FFDCFilter . processException ( ise , "com.ibm.ejs.j2c.ThreadIdentitySecurityHelper.beforeGettingConnection" , "20" , this ) ; Object [ ] parms = new Object [ ] { "ThreadIdentitySecurityHelper.beforeGettingConnection()" , ise } ; Tr . error ( tc , "ILLEGAL_STATE_EXCEPTION_J2CA0079" , parms ) ; ResourceException re = new ResourceException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() failed attempting to push the current user identity to the OS Thread" ) ; re . initCause ( ise ) ; throw re ; } catch ( ThreadIdentityException tie ) { FFDCFilter . processException ( tie , "com.ibm.ejs.j2c.ThreadIdentitySecurityHelper.beforeGettingConnection" , "21" , this ) ; ResourceException re = new ResourceException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() failed attempting to push the current user identity to the OS Thread" ) ; re . initCause ( tie ) ; throw re ; } return retObject ; }
Apply the given subject s identity to the thread .
36,506
private void checkForUTOKENNotFoundError ( Subject subj ) throws ResourceException { if ( m_ThreadIdentitySupport == AbstractConnectionFactoryService . THREAD_IDENTITY_REQUIRED ) { try { IllegalStateException e = new IllegalStateException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject not setup for using thread identity, but the connector requires thread identity be used." ) ; Object [ ] parms = new Object [ ] { "ThreadIdentitySecurityHelper.beforeGettingConnection()" , e } ; Tr . error ( tc , "ILLEGAL_STATE_EXCEPTION_J2CA0079" , parms ) ; throw e ; } catch ( IllegalStateException ise ) { ResourceException re = new ResourceException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject with illegal state" ) ; re . initCause ( ise ) ; throw re ; } } Set privateCredentials = subj . getPrivateCredentials ( ) ; Iterator privateIterator = privateCredentials . iterator ( ) ; if ( ! privateIterator . hasNext ( ) ) { try { IllegalStateException e = new IllegalStateException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject with no credentials." ) ; Object [ ] parms = new Object [ ] { "ThreadIdentitySecurityHelper.beforeGettingConnection()" , e } ; Tr . error ( tc , "ILLEGAL_STATE_EXCEPTION_J2CA0079" , parms ) ; throw e ; } catch ( IllegalStateException ise ) { ResourceException re = new ResourceException ( "ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject with illegal state" ) ; re . initCause ( ise ) ; throw re ; } } }
Check for an unexpected condition when a UTOKEN is not found in the Subject .
36,507
protected void copyStreams ( InputStream is , OutputStream os ) throws IOException { byte [ ] buffer = new byte [ 1024 ] ; try { int read ; while ( ( read = is . read ( buffer ) ) != - 1 ) { os . write ( buffer , 0 , read ) ; buffer = new byte [ 1024 ] ; } } finally { if ( null != os ) os . close ( ) ; if ( null != is ) is . close ( ) ; } }
Reads from the input stream and copies to the output stream
36,508
protected ExtractedFileInformation extractFileFromArchive ( String fileName , String regex ) throws RepositoryArchiveException , RepositoryArchiveEntryNotFoundException , RepositoryArchiveIOException { JarFile jarFile = null ; ExtractedFileInformation result = null ; File outputFile = null ; File sourceArchive = new File ( fileName ) ; try { try { jarFile = new JarFile ( sourceArchive ) ; } catch ( FileNotFoundException | NoSuchFileException fne ) { throw new RepositoryArchiveException ( "Unable to locate archive " + fileName , sourceArchive , fne ) ; } catch ( IOException ioe ) { throw new RepositoryArchiveIOException ( "Error opening archive " , sourceArchive , ioe ) ; } Enumeration < JarEntry > enumEntries = jarFile . entries ( ) ; while ( enumEntries . hasMoreElements ( ) ) { JarEntry entry = enumEntries . nextElement ( ) ; String name = entry . getName ( ) ; if ( Pattern . matches ( regex , name ) ) { outputFile = new File ( name ) ; outputFile = new File ( outputFile . getName ( ) ) ; outputFile . deleteOnExit ( ) ; try { copyStreams ( jarFile . getInputStream ( entry ) , new FileOutputStream ( outputFile ) ) ; } catch ( IOException ioe ) { throw new RepositoryArchiveIOException ( "Failed to extract file " + name + " inside " + fileName + " to " + outputFile . getAbsolutePath ( ) , sourceArchive , ioe ) ; } result = new ExtractedFileInformation ( outputFile , sourceArchive , name ) ; break ; } } } finally { try { if ( null != jarFile ) { jarFile . close ( ) ; } } catch ( IOException e ) { e . printStackTrace ( ) ; throw new RepositoryArchiveIOException ( "Error closing archive " , sourceArchive , e ) ; } } if ( null == outputFile ) { throw new RepositoryArchiveEntryNotFoundException ( "Failed to find file matching regular expression <" + regex + "> inside archive " + fileName , sourceArchive , regex ) ; } return result ; }
Extract a file from a jar file to a temporary location on disk that is deleted when the jvm exits .
36,509
protected void processLAandLI ( File archive , RepositoryResourceWritable resource , ProvisioningFeatureDefinition feature ) throws IOException , RepositoryException { String LAHeader = feature . getHeader ( LA_HEADER_FEATURE ) ; String LIHeader = feature . getHeader ( LI_HEADER_FEATURE ) ; processLAandLI ( archive , resource , LAHeader , LIHeader ) ; }
Locate and process license agreement and information files within a feature
36,510
protected void processLAandLI ( File archive , RepositoryResourceWritable resource , Manifest manifest ) throws RepositoryException , IOException { Attributes attribs = manifest . getMainAttributes ( ) ; String LAHeader = attribs . getValue ( LA_HEADER_PRODUCT ) ; String LIHeader = attribs . getValue ( LI_HEADER_PRODUCT ) ; processLAandLI ( archive , resource , LAHeader , LIHeader ) ; }
Locate and process license agreement and information files within a jar
36,511
public List < String > getRequiresFeature ( ArtifactMetadata amd ) { List < String > requiresFeature = new ArrayList < String > ( ) ; String requiresFeatureProp = amd . getProperty ( PROP_REQUIRE_FEATURE ) ; if ( requiresFeatureProp == null ) { return null ; } if ( requiresFeatureProp . equals ( "" ) ) { return requiresFeature ; } else { String [ ] features = requiresFeatureProp . split ( "\\," ) ; for ( String feature : features ) { requiresFeature . add ( feature . trim ( ) ) ; } return requiresFeature ; } }
Take the require . feature comma separated list and return a List of the entries
36,512
protected void processIcons ( ArtifactMetadata amd , RepositoryResourceWritable res ) throws RepositoryException { String current = "" ; String sizeString = "" ; String iconName = "" ; String iconNames = amd . getIcons ( ) ; if ( iconNames != null ) { iconNames . replaceAll ( "\\s" , "" ) ; StringTokenizer s = new StringTokenizer ( iconNames , "," ) ; while ( s . hasMoreTokens ( ) ) { current = s . nextToken ( ) ; int size = 0 ; if ( current . contains ( ";" ) ) { StringTokenizer t = new StringTokenizer ( current , ";" ) ; while ( t . hasMoreTokens ( ) ) { sizeString = t . nextToken ( ) ; if ( sizeString . contains ( "size=" ) ) { String sizes [ ] = sizeString . split ( "size=" ) ; size = Integer . parseInt ( sizes [ sizes . length - 1 ] ) ; } else { iconName = sizeString ; } } } else { iconName = current ; } File icon = this . extractFileFromArchive ( amd . getArchive ( ) . getAbsolutePath ( ) , iconName ) . getExtractedFile ( ) ; if ( icon . exists ( ) ) { AttachmentResourceWritable at = res . addAttachment ( icon , AttachmentType . THUMBNAIL ) ; if ( size != 0 ) { at . setImageDimensions ( size , size ) ; } } else { throw new RepositoryArchiveEntryNotFoundException ( "Icon does not exist" , amd . getArchive ( ) , iconName ) ; } } } }
Process icons from the properties file
36,513
public void reconstitute ( MessageProcessor processor , HashMap durableSubscriptionsTable , int startMode ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reconstitute" , new Object [ ] { processor , durableSubscriptionsTable , Integer . valueOf ( startMode ) } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Reconstituting MQLink " + getName ( ) ) ; try { super . reconstitute ( processor , durableSubscriptionsTable , startMode ) ; if ( _mqLinkStateItemStreamId != 0 ) { _mqLinkStateItemStream = ( ItemStream ) findById ( _mqLinkStateItemStreamId ) ; if ( _mqLinkStateItemStream == null && ! isToBeDeleted ( ) ) { SIResourceException e = new SIResourceException ( nls . getFormattedMessage ( "LINK_HANDLER_RECOVERY_ERROR_CWSIP0049" , new Object [ ] { getName ( ) } , null ) ) ; SibTr . error ( tc , "LINK_HANDLER_RECOVERY_ERROR_CWSIP0049" , new Object [ ] { getName ( ) } ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.MQLinkHandler.reconstitute" , "1:270:1.71" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstitute" , e ) ; throw e ; } } NonLockingCursor cursor = newNonLockingItemStreamCursor ( new ClassEqualsFilter ( MQLinkPubSubBridgeItemStream . class ) ) ; _mqLinkPubSubBridgeItemStream = ( MQLinkPubSubBridgeItemStream ) cursor . next ( ) ; if ( _mqLinkPubSubBridgeItemStream == null && ! isToBeDeleted ( ) ) { SIResourceException e = new SIResourceException ( nls . getFormattedMessage ( "LINK_HANDLER_RECOVERY_ERROR_CWSIP0049" , new Object [ ] { getName ( ) } , null ) ) ; SibTr . error ( tc , "LINK_HANDLER_RECOVERY_ERROR_CWSIP0049" , new Object [ ] { getName ( ) } ) ; FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.MQLinkHandler.reconstitute" , "1:303:1.71" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstitute" , e ) ; throw e ; } cursor . finished ( ) ; } catch ( Exception e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.MQLinkHandler.reconstitute" , "1:325:1.71" , this ) ; SibTr . exception ( tc , e ) ; _isCorruptOrIndoubt = true ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstitute" , e ) ; throw new SIResourceException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "reconstitute" ) ; }
Complete recovery of a MQLinkLocalizationItemStream retrieved from the MessageStore .
36,514
public void registerLink ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "registerLink" ) ; try { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Register MQLink: " + getUuid ( ) + ", with mqLinkManager" ) ; _mqLinkManager . define ( getUuid ( ) ) ; } catch ( LinkException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.MQLinkHandler.registerLink" , "1:804:1.71" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "registerLink" , e ) ; throw new SIResourceException ( e ) ; } registerDestination ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "registerLink" ) ; }
Registers the link with WLM
36,515
public void deregisterLink ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deregisterLink" ) ; deregisterDestination ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Deregister MQLink: " + getUuid ( ) + ", with mqLinkManager" ) ; _mqLinkManager . undefine ( getUuid ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deregisterLink" ) ; }
De - registers the link from WLM
36,516
public void stop ( int mode ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "stop" ) ; super . stop ( mode ) ; try { if ( _mqLinkObject != null ) _mqLinkObject . stop ( ) ; } catch ( SIResourceException e ) { SibTr . exception ( tc , e ) ; } catch ( SIException e ) { SibTr . exception ( tc , e ) ; } _mqLinkManager . undefine ( getUuid ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "stop" ) ; }
This stop method overrides the stop method in BaseDestinationHandler and is driven when the ME is stopped . As well as performing the normal stop processing for the MQLink object it also ensures that the uuid of the the MQLink is undefined from the set managed by the TRM . Otherwise there is the potential to add the uuid of the same MQLink twice .
36,517
public void announceMPStarted ( int startMode , JsMessagingEngine me ) throws SIResourceException , SIException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "announceMPStarted" , new Object [ ] { startMode , me } ) ; if ( _mqLinkObject != null ) _mqLinkObject . mpStarted ( startMode , me ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "announceMPStarted" ) ; }
Alert the MQLink and PSB components that MP has now started .
36,518
public void destroy ( ) throws SIResourceException , SIException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "destroy" ) ; if ( _mqLinkObject != null ) _mqLinkObject . destroy ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "destroy" ) ; }
Alert the MQLink and PSB components that destroy has been driven .
36,519
void recycle ( ) { flushed = false ; closed = false ; out = null ; nextChar = 0 ; converterBuffer . clear ( ) ; response = null ; }
Package - level access
36,520
public final void clear ( ) throws IOException { if ( ( bufferSize == 0 ) && ( out != null ) ) throw new IllegalStateException ( "jsp.error.ise_on_clear" ) ; if ( flushed ) throw new IOException ( "jsp.error.attempt_to_clear_flushed_buffer" ) ; if ( closed ) { throw new IOException ( "Stream closed" ) ; } nextChar = 0 ; }
Discard the output buffer .
36,521
public static File [ ] getUserExtensionVersionFiles ( File installDir ) { File [ ] versionFiles = null ; String userDirLoc = System . getenv ( BootstrapConstants . ENV_WLP_USER_DIR ) ; File userDir = ( userDirLoc != null ) ? new File ( userDirLoc ) : ( ( installDir != null ) ? new File ( installDir , "usr" ) : null ) ; if ( userDir != null && userDir . exists ( ) ) { File userExtVersionDir = new File ( userDir , "extension/lib/versions" ) ; if ( userExtVersionDir . exists ( ) ) { versionFiles = userExtVersionDir . listFiles ( versionFileFilter ) ; } } return versionFiles ; }
Retrieves the product extension jar bundles located in the installation s usr directory .
36,522
private String getUserFromUniqueID ( String id ) { if ( id == null ) { return "" ; } id = id . trim ( ) ; int realmDelimiterIndex = id . indexOf ( "/" ) ; if ( realmDelimiterIndex < 0 ) { return "" ; } else { return id . substring ( realmDelimiterIndex + 1 ) ; } }
New method added as an alternative of getUserFromUniqueId method of WSSecurityPropagationHelper
36,523
private void checkNotClosed ( ) throws SIConnectionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkNotClosed" ) ; synchronized ( this ) { if ( _closed ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkNotClosed" , "Connection Closed exception" ) ; SIMPConnectionUnavailableException e = new SIMPConnectionUnavailableException ( nls_cwsik . getFormattedMessage ( "DELIVERY_ERROR_SIRC_22" , new Object [ ] { _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; e . setExceptionReason ( SIRCConstants . SIRC0022_OBJECT_CLOSED_ERROR ) ; e . setExceptionInserts ( new String [ ] { _messageProcessor . getMessagingEngineName ( ) } ) ; throw e ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkNotClosed" ) ; }
Check if this connection has been closed . If it has a SIObjectClosedException is thrown .
36,524
void removeBrowserSession ( BrowserSessionImpl browser ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeBrowserSession" , browser ) ; synchronized ( _browsers ) { _browsers . remove ( browser ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeBrowserSession" ) ; }
This method simply removes a Browser Session from our list . It is generally called by the Browser Session as it is closing down .
36,525
void removeConsumerSession ( ConsumerSessionImpl consumer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeConsumerSession" , consumer ) ; synchronized ( _consumers ) { _consumers . remove ( consumer ) ; } _messageProcessor . removeConsumer ( consumer ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeConsumerSession" ) ; }
This method simply removes a Consumer Session from our list . It is generally called by the Consumer Session as it is closing down .
36,526
void removeProducerSession ( ProducerSessionImpl producer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeProducerSession" ) ; synchronized ( _producers ) { _producers . remove ( producer ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "removeProducerSession" ) ; }
This method simply removes a Producer Session from our list . It is generally called by the Producer Session as it is closing down .
36,527
private ProducerSession internalCreateProducerSession ( SIDestinationAddress destAddress , DestinationType destinationType , boolean system , SecurityContext secContext , boolean keepSecurityUserid , boolean fixedMessagePoint , boolean preferLocal , boolean clearPubSubFingerprints , String discriminator ) throws SIConnectionUnavailableException , SIConnectionDroppedException , SIErrorException , SITemporaryDestinationNotFoundException , SIIncorrectCallException , SIResourceException , SINotPossibleInCurrentConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "internalCreateProducerSession" , new Object [ ] { destAddress , destinationType , system , secContext , keepSecurityUserid , fixedMessagePoint , preferLocal , clearPubSubFingerprints } ) ; String destinationName = destAddress . getDestinationName ( ) ; String busName = destAddress . getBusName ( ) ; DestinationHandler destination = _destinationManager . getDestination ( destinationName , busName , false , true ) ; checkDestinationType ( destinationType , destAddress , destination , system ) ; checkDestinationAuthority ( destination , MessagingSecurityConstants . OPERATION_TYPE_SEND , discriminator ) ; ProducerSession producer = null ; synchronized ( this ) { checkNotClosed ( ) ; producer = new ProducerSessionImpl ( destAddress , destination , this , secContext , keepSecurityUserid , fixedMessagePoint , preferLocal , clearPubSubFingerprints ) ; synchronized ( _producers ) { _producers . add ( producer ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "internalCreateProducerSession" , producer ) ; return producer ; }
Method that creates the producer session .
36,528
private void checkTemporary ( DestinationHandler destination , boolean mqinterop ) throws SITemporaryDestinationNotFoundException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkTemporary" , new Object [ ] { destination , Boolean . valueOf ( mqinterop ) } ) ; if ( destination . isTemporary ( ) && ! mqinterop && ( _temporaryDestinations . indexOf ( destination . getName ( ) ) == - 1 ) ) { SIMPTemporaryDestinationNotFoundException e = new SIMPTemporaryDestinationNotFoundException ( nls . getFormattedMessage ( "TEMPORARY_DESTINATION_CONNECTION_ERROR_CWSIP0099" , new Object [ ] { destination . getName ( ) } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exception ( tc , e ) ; SibTr . exit ( tc , "checkTemporary" , e ) ; } throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkTemporary" ) ; }
Checks to see if the destination is temporary and the connection used to create the temp destination is the same as the one trying to access it .
36,529
private ConsumerSession internalCreateConsumerSession ( SIDestinationAddress destAddr , String alternateUser , DestinationType destinationType , SelectionCriteria criteria , Reliability reliability , boolean enableReadAhead , boolean nolocal , boolean forwardScanning , boolean system , Reliability unrecoverableReliability , boolean bifurcatable , boolean mqinterop , boolean ignoreInitialIndoubts , boolean gatherMessages ) throws SIConnectionUnavailableException , SIConnectionDroppedException , SIResourceException , SIConnectionLostException , SILimitExceededException , SIErrorException , SINotAuthorizedException , SIIncorrectCallException , SIDestinationLockedException , SINotPossibleInCurrentConfigurationException , SITemporaryDestinationNotFoundException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "internalCreateConsumerSession" , new Object [ ] { destAddr , alternateUser , destinationType , criteria , reliability , Boolean . valueOf ( enableReadAhead ) , Boolean . valueOf ( nolocal ) , Boolean . valueOf ( forwardScanning ) , Boolean . valueOf ( system ) , unrecoverableReliability , Boolean . valueOf ( bifurcatable ) , Boolean . valueOf ( mqinterop ) , Boolean . valueOf ( ignoreInitialIndoubts ) , Boolean . valueOf ( gatherMessages ) } ) ; try { return internalCreateConsumerSession ( null , destAddr , alternateUser , destinationType , criteria , reliability , enableReadAhead , nolocal , forwardScanning , system , unrecoverableReliability , bifurcatable , mqinterop , ignoreInitialIndoubts , gatherMessages ) ; } finally { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "internalCreateConsumerSession" ) ; } }
Internal method for creating the consumer .
36,530
private SIBUuid8 checkDurableSubscriptionInformation ( String subscriptionName , String durableSubscriptionHome , SIDestinationAddress destinationAddress , boolean supportsMultipleConsumers , boolean nolocal , boolean delete , boolean createForDurSub ) throws SIIncorrectCallException , SIConnectionUnavailableException { durableSubscriptionHome = _messageProcessor . getMessagingEngineName ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkDurableSubscriptionInformation" , new Object [ ] { subscriptionName , destinationAddress , Boolean . valueOf ( supportsMultipleConsumers ) , Boolean . valueOf ( nolocal ) } ) ; checkNotClosed ( ) ; if ( subscriptionName == null ) { String exText = "CREATE_DURABLE_SUB_CWSIR0042" ; if ( createForDurSub ) exText = "CREATE_DURABLE_SUB_CWSIR0032" ; else if ( delete ) exText = "DELETE_DURABLE_SUB_CWSIR0061" ; SIIncorrectCallException e = new SIIncorrectCallException ( nls_cwsir . getFormattedMessage ( exText , null , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exception ( tc , e ) ; SibTr . exit ( tc , "checkDurableSubscriptionInformation" , e ) ; } throw e ; } if ( destinationAddress == null && ! delete ) { String exText = "CREATE_DURABLE_SUB_CWSIR0041" ; if ( createForDurSub ) exText = "CREATE_DURABLE_SUB_CWSIR0031" ; SIIncorrectCallException e = new SIIncorrectCallException ( nls_cwsir . getFormattedMessage ( exText , null , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exception ( tc , e ) ; SibTr . exit ( tc , "checkDurableSubscriptionInformation" , e ) ; } throw e ; } SIBUuid8 durableHomeID = _messageProcessor . mapMeNameToUuid ( durableSubscriptionHome ) ; if ( durableHomeID == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkDurableSubscriptionInformation" , "SIMENotFoundException" ) ; throw new SIIncorrectCallException ( nls . getFormattedMessage ( "REMOTE_ME_MAPPING_ERROR_CWSIP0156" , new Object [ ] { durableSubscriptionHome } , null ) ) ; } if ( nolocal && supportsMultipleConsumers ) { SIIncorrectCallException e = new SIIncorrectCallException ( nls . getFormattedMessage ( "INVALID_PARAMETER_COMBINATION_ERROR_CWSIP0100" , new Object [ ] { subscriptionName , destinationAddress . getDestinationName ( ) , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exception ( tc , e ) ; SibTr . exit ( tc , "checkDurableSubscriptionInformation" , e ) ; } throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkDurableSubscriptionInformation" , durableHomeID ) ; return durableHomeID ; }
Checks made for durable subscription support .
36,531
private SIBusMessage internalReceiveNoWait ( SITransaction tran , Reliability unrecoverableReliability , SIDestinationAddress destAddr , DestinationType destinationType , SelectionCriteria criteria , Reliability reliability , String alternateUser , boolean system ) throws SIConnectionDroppedException , SIConnectionUnavailableException , SIConnectionLostException , SILimitExceededException , SINotAuthorizedException , SIDestinationLockedException , SITemporaryDestinationNotFoundException , SIResourceException , SIErrorException , SIIncorrectCallException , SINotPossibleInCurrentConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "internalReceiveNoWait" , new Object [ ] { destAddr , alternateUser , destinationType , criteria , tran , reliability , unrecoverableReliability , Boolean . valueOf ( system ) } ) ; if ( destAddr == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "internalReceiveNoWait" , "SIIncorrectCallException - null destAddr" ) ; throw new SIIncorrectCallException ( nls_cwsir . getFormattedMessage ( "RECEIVE_NO_WAIT_CWSIR0091" , null , null ) ) ; } SIBusMessage message = null ; if ( tran != null && ! ( ( TransactionCommon ) tran ) . isAlive ( ) ) { SIIncorrectCallException e = new SIIncorrectCallException ( nls . getFormattedMessage ( "TRANSACTION_RECEIVE_USAGE_ERROR_CWSIP0777" , new Object [ ] { destAddr } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "internalReceiveNoWait" , e ) ; throw e ; } try { ConsumerSession session = internalCreateConsumerSession ( destAddr , alternateUser , destinationType , criteria , reliability , false , false , false , system , unrecoverableReliability , false , false , true , false ) ; session . start ( false ) ; message = session . receiveNoWait ( tran ) ; session . close ( ) ; } catch ( SISessionUnavailableException e ) { SibTr . exception ( tc , e ) ; checkNotClosed ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "internalReceiveNoWait" , e ) ; throw new SIMPConnectionUnavailableException ( nls_cwsik . getFormattedMessage ( "DELIVERY_ERROR_SIRC_22" , new Object [ ] { _messageProcessor . getMessagingEngineName ( ) } , null ) , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "internalReceiveNoWait" , message ) ; return message ; }
Internal implementation for receiving no wait
36,532
private BrowserSession createBrowserSession ( SIDestinationAddress destinationAddress , DestinationType destinationType , SelectionCriteria criteria , boolean system , String alternateUser , boolean gatherMessages ) throws SIConnectionUnavailableException , SIConnectionDroppedException , SIErrorException , SITemporaryDestinationNotFoundException , SIResourceException , SINotPossibleInCurrentConfigurationException , SISelectorSyntaxException , SIDiscriminatorSyntaxException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createBrowserSession" , new Object [ ] { destinationAddress , destinationType , criteria , Boolean . valueOf ( gatherMessages ) } ) ; DestinationHandler destination = _destinationManager . getDestination ( ( JsDestinationAddress ) destinationAddress , false ) ; checkDestinationType ( destinationType , destinationAddress , destination , system ) ; if ( destination . getDestinationType ( ) == DestinationType . SERVICE ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createBrowserSession" , "cannot browse a service destination" ) ; throw new SINotPossibleInCurrentConfigurationException ( nls . getFormattedMessage ( "INVALID_DESTINATION_USAGE_ERROR_CWSIP0022" , new Object [ ] { destination . getName ( ) , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; } checkTemporary ( destination , false ) ; checkDestinationAuthority ( destination , MessagingSecurityConstants . OPERATION_TYPE_BROWSE , null ) ; if ( destination . isPubSub ( ) ) { destination = null ; } BrowserSession browser = null ; synchronized ( this ) { checkNotClosed ( ) ; browser = new BrowserSessionImpl ( destination , criteria , this , destinationAddress , gatherMessages ) ; synchronized ( _browsers ) { _browsers . add ( browser ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createBrowserSession" , browser ) ; return browser ; }
Creates the Browser session .
36,533
private static final boolean isDestinationPrefixValid ( String destinationPrefix ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isDestinationPrefixValid" , destinationPrefix ) ; boolean isValid = true ; if ( null != destinationPrefix ) { int len = destinationPrefix . length ( ) ; if ( len > 24 ) { isValid = false ; } else { int along = 0 ; while ( ( along < len ) && isValid ) { char c = destinationPrefix . charAt ( along ) ; if ( ! ( ( 'A' <= c ) && ( 'Z' >= c ) ) ) { if ( ! ( ( 'a' <= c ) && ( 'z' >= c ) ) ) { if ( ! ( ( '0' <= c ) && ( '9' >= c ) ) ) { if ( '.' != c && '/' != c && '%' != c ) { isValid = false ; } } } } along += 1 ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "isDestinationPrefixValid" , Boolean . valueOf ( isValid ) ) ; return isValid ; }
Determines whether a destination prefix for a System destination is valid or not .
36,534
public ItemStream getMQLinkPubSubBridgeItemStream ( String mqLinkUuidStr ) throws SIException { MQLinkHandler mqLinkHandler = null ; ItemStream mqLinkPubSubBridgeItemStream = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMQLinkPubSubBridgeItemStream" , mqLinkUuidStr ) ; checkNotClosed ( ) ; if ( mqLinkUuidStr == null ) { SIIncorrectCallException e = new SIIncorrectCallException ( nls . getFormattedMessage ( "MISSING_PARAM_ERROR_CWSIP0029" , new Object [ ] { "1:5583:1.347.1.25" } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exception ( tc , e ) ; SibTr . exit ( tc , "getMQLinkPubSubBridgeItemStream" , e ) ; } throw e ; } SIBUuid8 mqLinkUuid = new SIBUuid8 ( mqLinkUuidStr ) ; mqLinkHandler = _destinationManager . getMQLinkLocalization ( mqLinkUuid , false ) ; if ( mqLinkHandler == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMQLinkPubSubBridgeItemStream" , "SINotPossibleInCurrentConfigurationException" ) ; throw new SINotPossibleInCurrentConfigurationException ( nls . getFormattedMessage ( "MQLINK_PSB_ERROR_CWSIP0027" , new Object [ ] { mqLinkUuid , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; } mqLinkPubSubBridgeItemStream = mqLinkHandler . getMqLinkPubSubBridgeItemStream ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMQLinkPubSubBridgeItemStream" , mqLinkPubSubBridgeItemStream ) ; return mqLinkPubSubBridgeItemStream ; }
Retrieves the MQLink s PubSubBridge ItemStream
36,535
void removeBifurcatedConsumerSession ( BifurcatedConsumerSessionImpl bifurcatedConsumer ) { if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConnection . tc . isEntryEnabled ( ) ) SibTr . entry ( CoreSPIConnection . tc , "removeBifurcatedConsumerSession" , new Object [ ] { this , bifurcatedConsumer } ) ; synchronized ( _bifurcatedConsumers ) { _bifurcatedConsumers . remove ( bifurcatedConsumer ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && CoreSPIConnection . tc . isEntryEnabled ( ) ) SibTr . exit ( CoreSPIConnection . tc , "removeBifurcatedConsumerSession" ) ; }
Remove a bifurcated consumer from the connection list .
36,536
private boolean checkConsumerDiscriminatorAccess ( DestinationHandler destination , String discriminator , SecurityContext secContext ) throws SIDiscriminatorSyntaxException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkConsumerDiscriminatorAccess" , new Object [ ] { destination , discriminator , secContext } ) ; boolean allowed = true ; if ( discriminator != null && ! _messageProcessor . getMessageProcessorMatching ( ) . isWildCarded ( discriminator ) ) { secContext . setDiscriminator ( discriminator ) ; if ( ! destination . checkDiscriminatorAccess ( secContext , OperationType . RECEIVE ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkConsumerDiscriminatorAccess" , "not authorized to consume from this destination's discriminator" ) ; SibTr . audit ( tc , nls . getFormattedMessage ( "USER_NOT_AUTH_RECEIVE_ERROR_CWSIP0310" , new Object [ ] { destination . getName ( ) , discriminator , secContext . getUserName ( false ) } , null ) ) ; allowed = false ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkConsumerDiscriminatorAccess" , Boolean . valueOf ( allowed ) ) ; return allowed ; }
Checks the authority of a consumer to consume from a discriminator
36,537
private void checkInquireAuthority ( DestinationHandler destination , String destinationName , String busName , SecurityContext secContext , boolean temporary ) throws SINotAuthorizedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkInquireAuthority" , new Object [ ] { destination , destinationName , busName , secContext , Boolean . valueOf ( temporary ) } ) ; if ( ! temporary ) { if ( ! destination . checkDestinationAccess ( secContext , OperationType . INQUIRE ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkInquireAuthority" , "not authorized to inquire on this destination" ) ; String userName = secContext . getUserName ( true ) ; String nlsMessage ; if ( destinationName != null ) { nlsMessage = nls . getFormattedMessage ( "USER_NOT_AUTH_INQUIRE_ERROR_CWSIP0314" , new Object [ ] { destinationName , userName } , null ) ; _accessChecker . fireDestinationAccessNotAuthorizedEvent ( destinationName , userName , OperationType . INQUIRE , nlsMessage ) ; } else { nlsMessage = nls . getFormattedMessage ( "USER_NOT_AUTH_INQUIRE_FB_ERROR_CWSIP0315" , new Object [ ] { busName , userName } , null ) ; _accessChecker . fireDestinationAccessNotAuthorizedEvent ( busName , userName , OperationType . INQUIRE , nlsMessage ) ; } throw new SINotAuthorizedException ( nlsMessage ) ; } } else { String destinationPrefix = SIMPUtils . parseTempPrefix ( destinationName ) ; if ( ! _accessChecker . checkTemporaryDestinationAccess ( secContext , destinationName , ( destinationPrefix == null ) ? "" : destinationPrefix , OperationType . INQUIRE ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkInquireAuthority" , "not authorized to inquire on temporary destination" ) ; String userName = secContext . getUserName ( true ) ; String nlsMessage = nls . getFormattedMessage ( "USER_NOT_AUTH_INQUIRE_ERROR_CWSIP0314" , new Object [ ] { destinationPrefix , userName } , null ) ; _accessChecker . fireDestinationAccessNotAuthorizedEvent ( destinationPrefix , userName , OperationType . INQUIRE , nlsMessage ) ; throw new SINotAuthorizedException ( nlsMessage ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkInquireAuthority" ) ; }
Checks the authority to inquire on a destination
36,538
private boolean isSIBServerSubject ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isSIBServerSubject" ) ; boolean ispriv = false ; if ( _subject != null ) ispriv = _messageProcessor . getAuthorisationUtils ( ) . isSIBServerSubject ( _subject ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "isSIBServerSubject" , Boolean . valueOf ( ispriv ) ) ; return ispriv ; }
Returns true if the subject associated with the connection is the privileged SIBServerSubject .
36,539
public boolean isMulticastEnabled ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isMulticastEnabled" ) ; boolean enabled = _messageProcessor . isMulticastEnabled ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "isMulticastEnabled" , Boolean . valueOf ( enabled ) ) ; return enabled ; }
Returns true if multicast is enabled
36,540
public MulticastProperties getMulticastProperties ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMulticastProperties" ) ; MulticastProperties props = _messageProcessor . getMulticastProperties ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMulticastProperties" , props ) ; return props ; }
Returns the MulticastProperties for this messaging engine null if multicast is not enabled .
36,541
private void checkDestinationAccess ( DestinationHandler destination , String destinationName , String busName , SecurityContext secContext ) throws SINotAuthorizedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkDestinationAccess" , new Object [ ] { destination , destinationName , busName , secContext } ) ; if ( ! destination . checkDestinationAccess ( secContext , OperationType . SEND ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkDestinationAccess" , "not authorized to produce to this destination" ) ; SIMPNotAuthorizedException e = new SIMPNotAuthorizedException ( nls_cwsik . getFormattedMessage ( "DELIVERY_ERROR_SIRC_18" , new Object [ ] { destinationName , secContext . getUserName ( false ) } , null ) ) ; e . setExceptionReason ( SIRCConstants . SIRC0018_USER_NOT_AUTH_SEND_ERROR ) ; e . setExceptionInserts ( new String [ ] { destinationName , secContext . getUserName ( false ) } ) ; throw e ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkDestinationAccess" ) ; }
Checks the authority of a producer to produce to a destination
36,542
public MPSubscription getSubscription ( String subscriptionName ) throws SIDurableSubscriptionNotFoundException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getSubscription" , subscriptionName ) ; HashMap durableSubs = _destinationManager . getDurableSubscriptionsTable ( ) ; ConsumerDispatcher cd = null ; synchronized ( durableSubs ) { cd = ( ConsumerDispatcher ) durableSubs . get ( subscriptionName ) ; if ( cd == null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getSubscription" , "Durable sub not found" ) ; throw new SIDurableSubscriptionNotFoundException ( nls . getFormattedMessage ( "SUBSCRIPTION_DOESNT_EXIST_ERROR_CWSIP0072" , new Object [ ] { subscriptionName , _messageProcessor . getMessagingEngineName ( ) } , null ) ) ; } } MPSubscription mpSubscription = cd . getMPSubscription ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getSubscription" , mpSubscription ) ; return mpSubscription ; }
Retrieve the MPSubscription object that represents the named durable subscription
36,543
public void deregisterConsumerSetMonitor ( ConsumerSetChangeCallback callback ) throws SINotPossibleInCurrentConfigurationException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deregisterConsumerSetMonitor" , new Object [ ] { callback } ) ; _messageProcessor . getMessageProcessorMatching ( ) . deregisterConsumerSetMonitor ( this , callback ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deregisterConsumerSetMonitor" ) ; }
Deregisters a previously registered callback .
36,544
public Map getConnectionProperties ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getConnectionProperties" ) ; SibTr . exit ( tc , "getConnectionProperties" , _connectionProperties ) ; } return _connectionProperties ; }
Retrieve the properties associated with this connection .
36,545
public void setConnectionProperties ( Map connectionProperties ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getConnectionProperties" , connectionProperties ) ; SibTr . exit ( tc , "getConnectionProperties" ) ; } _connectionProperties = connectionProperties ; }
Set the properties associated with this connection . Supports Unittest environment .
36,546
private void stopChain ( String name , Event event ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Stop chain event; chain=" + name ) ; } ChannelFramework cf = ChannelFrameworkFactory . getChannelFramework ( ) ; try { if ( cf . isChainRunning ( name ) ) { cf . stopChain ( name , 0L ) ; } } catch ( Exception e ) { FFDCFilter . processException ( e , getClass ( ) . getName ( ) , "stopChain" , new Object [ ] { event , cf } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Error stopping chain; " + e ) ; } } }
Stop the explicit chain provided .
36,547
private static WebServiceRefPartialInfo buildPartialInfoFromWebServiceClient ( Class < ? > serviceInterfaceClass ) { WebServiceClient webServiceClient = serviceInterfaceClass . getAnnotation ( WebServiceClient . class ) ; if ( webServiceClient == null ) { return null ; } String className = serviceInterfaceClass . getName ( ) ; String wsdlLocation = webServiceClient . wsdlLocation ( ) ; QName serviceQName = null ; String localPart = webServiceClient . name ( ) ; if ( localPart != null ) { serviceQName = new QName ( webServiceClient . targetNamespace ( ) , localPart ) ; } String handlerChainDeclaringClassName = null ; javax . jws . HandlerChain handlerChainAnnotation = serviceInterfaceClass . getAnnotation ( javax . jws . HandlerChain . class ) ; if ( handlerChainAnnotation != null ) handlerChainDeclaringClassName = serviceInterfaceClass . getName ( ) ; WebServiceRefPartialInfo partialInfo = new WebServiceRefPartialInfo ( className , wsdlLocation , serviceQName , null , handlerChainDeclaringClassName , handlerChainAnnotation ) ; return partialInfo ; }
This method will build a ServiceRefPartialInfo object from a class with an
36,548
public Map < ConfigID , List < T > > collectElementsById ( Map < ConfigID , List < T > > map , String defaultId , String pid ) { if ( map == null ) { map = new HashMap < ConfigID , List < T > > ( ) ; } int index = 0 ; for ( T configElement : configElements ) { String id = configElement . getId ( ) ; if ( id == null ) { if ( defaultId != null ) { id = defaultId ; } else { id = generateId ( index ++ ) ; } } ConfigID configID = configElement . getConfigID ( ) ; configID = new ConfigID ( configID . getParent ( ) , pid , id , configID . getChildAttribute ( ) ) ; List < T > elements = map . get ( configID ) ; if ( elements == null ) { elements = new ArrayList < T > ( ) ; map . put ( configID , elements ) ; } elements . add ( configElement ) ; } return map ; }
Collects elements into Lists based on their ID . If an ID is not specified the defaultId will be used . If the defaultId is null an id will be generated .
36,549
public static long readLong ( byte b [ ] , int offset ) { long retValue ; retValue = ( ( long ) b [ offset ++ ] ) << 56 ; retValue |= ( ( long ) b [ offset ++ ] & 0xff ) << 48 ; retValue |= ( ( long ) b [ offset ++ ] & 0xff ) << 40 ; retValue |= ( ( long ) b [ offset ++ ] & 0xff ) << 32 ; retValue |= ( ( long ) b [ offset ++ ] & 0xff ) << 24 ; retValue |= ( ( long ) b [ offset ++ ] & 0xff ) << 16 ; retValue |= ( ( long ) b [ offset ++ ] & 0xff ) << 8 ; retValue |= ( long ) b [ offset ] & 0xff ; return retValue ; }
Unserializes a long from a byte array at a specific offset in big - endian order
36,550
public static void writeLong ( byte b [ ] , int offset , long value ) { b [ offset ++ ] = ( byte ) ( value >>> 56 ) ; b [ offset ++ ] = ( byte ) ( value >>> 48 ) ; b [ offset ++ ] = ( byte ) ( value >>> 40 ) ; b [ offset ++ ] = ( byte ) ( value >>> 32 ) ; b [ offset ++ ] = ( byte ) ( value >>> 24 ) ; b [ offset ++ ] = ( byte ) ( value >>> 16 ) ; b [ offset ++ ] = ( byte ) ( value >>> 8 ) ; b [ offset ] = ( byte ) value ; }
Serializes a long into a byte array at a specific offset in big - endian order
36,551
public static int readInt ( byte b [ ] , int offset ) { int retValue ; retValue = ( ( int ) b [ offset ++ ] ) << 24 ; retValue |= ( ( int ) b [ offset ++ ] & 0xff ) << 16 ; retValue |= ( ( int ) b [ offset ++ ] & 0xff ) << 8 ; retValue |= ( int ) b [ offset ] & 0xff ; return retValue ; }
Unserializes an int from a byte array at a specific offset in big - endian order
36,552
public static void writeInt ( byte [ ] b , int offset , int value ) { b [ offset ++ ] = ( byte ) ( value >>> 24 ) ; b [ offset ++ ] = ( byte ) ( value >>> 16 ) ; b [ offset ++ ] = ( byte ) ( value >>> 8 ) ; b [ offset ] = ( byte ) value ; }
Serializes an int into a byte array at a specific offset in big - endian order
36,553
public static short readShort ( byte b [ ] , int offset ) { int retValue ; retValue = b [ offset ++ ] << 8 ; retValue |= b [ offset ] & 0xff ; return ( short ) retValue ; }
Unserializes a short from a byte array at a specific offset in big - endian order
36,554
public static void writeShort ( byte b [ ] , int offset , short value ) { b [ offset ++ ] = ( byte ) ( value >>> 8 ) ; b [ offset ] = ( byte ) value ; }
Serializes a short into a byte array at a specific offset in big - endian order
36,555
public static void establishSSLContext ( HttpClient client , int port , LibertyServer server ) { establishSSLContext ( client , port , server , null , null , null , null , "TLSv1.2" ) ; }
Adds an SSL context to the HttpClient . No trust or client certificate is established and a trust - all policy is assumed .
36,556
public final void fireEvent ( EventObject evt , EventListenerV visitor ) { EventListener [ ] list = getListenerArray ( ) ; for ( int i = 0 ; i < list . length ; i ++ ) { if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) logger . logp ( Level . FINE , CLASS_NAME , "fireEvent" , "Use visitor " + visitor + " to fire event to " + list [ i ] + ", class:" + list [ i ] . getClass ( ) ) ; visitor . fireEvent ( evt , list [ i ] ) ; } }
Fire the event to all listeners by allowing the visitor to visit each listener . The visitor is responsible for implementing the actual firing of the event to each listener .
36,557
public final synchronized void addListener ( EventListener l ) { if ( l == null ) { throw new IllegalArgumentException ( "Listener " + l + " is null" ) ; } if ( listeners == EMPTY_LISTENERS ) { listeners = new EventListener [ 1 ] ; listeners [ 0 ] = l ; } else { int i = listeners . length ; EventListener [ ] tmp = new EventListener [ i + 1 ] ; System . arraycopy ( listeners , 0 , tmp , 0 , i ) ; tmp [ i ] = l ; listeners = tmp ; } }
Add the listener as a listener to the list .
36,558
public final synchronized void removeListener ( EventListener l ) { if ( l == null ) { throw new IllegalArgumentException ( "Listener " + l + " is null" ) ; } int index = - 1 ; for ( int i = listeners . length - 1 ; i >= 0 ; i -- ) { if ( listeners [ i ] . equals ( l ) == true ) { index = i ; break ; } } if ( index != - 1 ) { EventListener [ ] tmp = new EventListener [ listeners . length - 1 ] ; System . arraycopy ( listeners , 0 , tmp , 0 , index ) ; if ( index < tmp . length ) System . arraycopy ( listeners , index + 1 , tmp , index , tmp . length - index ) ; listeners = ( tmp . length == 0 ) ? EMPTY_LISTENERS : tmp ; } }
Remove the listener .
36,559
private ClassLoader getClassLoaderForInterfaces ( final ClassLoader loader , final Class < ? > [ ] interfaces ) { if ( canSeeAllInterfaces ( loader , interfaces ) ) { LOG . log ( Level . FINE , "current classloader " + loader + " can see all interface" ) ; return loader ; } String sortedNameFromInterfaceArray = getSortedNameFromInterfaceArray ( interfaces ) ; ClassLoader cachedLoader = proxyClassLoaderCache . getProxyClassLoader ( loader , interfaces ) ; if ( canSeeAllInterfaces ( cachedLoader , interfaces ) ) { LOG . log ( Level . FINE , "find required loader from ProxyClassLoader cache with key" + sortedNameFromInterfaceArray ) ; return cachedLoader ; } else { LOG . log ( Level . FINE , "find a loader from ProxyClassLoader cache with interfaces " + sortedNameFromInterfaceArray + " but can't see all interfaces" ) ; for ( Class < ? > currentInterface : interfaces ) { String ifName = currentInterface . getName ( ) ; if ( ! ifName . startsWith ( "org.apache.cxf" ) && ! ifName . startsWith ( "java" ) ) { proxyClassLoaderCache . removeStaleProxyClassLoader ( currentInterface ) ; cachedLoader = proxyClassLoaderCache . getProxyClassLoader ( loader , interfaces ) ; } } } return cachedLoader ; }
Return a classloader that can see all the given interfaces If the given loader can see all interfaces then it is used . If not then a combined classloader of all interface classloaders is returned .
36,560
private Application getMyfacesApplicationInstance ( ) { FacesContext facesContext = FacesContext . getCurrentInstance ( ) ; if ( facesContext != null ) { ExternalContext externalContext = facesContext . getExternalContext ( ) ; if ( externalContext != null ) { return ( Application ) externalContext . getApplicationMap ( ) . get ( "org.apache.myfaces.application.ApplicationImpl" ) ; } } return null ; }
Retrieve the current Myfaces Application Instance lookup on the application map . All methods introduced on jsf 1 . 2 for Application interface should thrown by default UnsupportedOperationException but the ri scan and find the original Application impl and redirect the call to that method instead throwing it allowing application implementations created before jsf 1 . 2 continue working .
36,561
protected ClassLoader buildClassLoader ( final List < URL > urlList , String verifyJarProperty ) { if ( libertyBoot ) { return AccessController . doPrivileged ( new PrivilegedAction < ClassLoader > ( ) { public ClassLoader run ( ) { return getClass ( ) . getClassLoader ( ) ; } } ) ; } final boolean verifyJar ; if ( System . getSecurityManager ( ) == null ) { verifyJar = "true" . equalsIgnoreCase ( verifyJarProperty ) ; } else { verifyJar = true ; } enableJava2SecurityIfSet ( this . bootProps , urlList ) ; ClassLoader loader = AccessController . doPrivileged ( new PrivilegedAction < ClassLoader > ( ) { public ClassLoader run ( ) { ClassLoader parent = getClass ( ) . getClassLoader ( ) ; URL [ ] urls = urlList . toArray ( new URL [ urlList . size ( ) ] ) ; if ( verifyJar ) { return new BootstrapChildFirstURLClassloader ( urls , parent ) ; } else { try { return new BootstrapChildFirstJarClassloader ( urls , parent ) ; } catch ( RuntimeException e ) { return new BootstrapChildFirstURLClassloader ( urls , parent ) ; } } } } ) ; return loader ; }
Build the nested classloader containing the OSGi framework and the log provider .
36,562
public static void enableJava2SecurityIfSet ( BootstrapConfig bootProps , List < URL > urlList ) { if ( bootProps . get ( BootstrapConstants . JAVA_2_SECURITY_PROPERTY ) != null ) { NameBasedLocalBundleRepository repo = new NameBasedLocalBundleRepository ( bootProps . getInstallRoot ( ) ) ; urlList . add ( getJarFileFromBundleName ( repo , "com.ibm.ws.org.eclipse.equinox.region" , "[1.0,1.0.100)" ) ) ; urlList . add ( getJarFileFromBundleName ( repo , "com.ibm.ws.kernel.instrument.serialfilter" , "[1.0,1.0.100)" ) ) ; addJarFileIfExist ( urlList , bootProps . getInstallRoot ( ) + "/bin/tools/ws-javaagent.jar" ) ; addJarFileIfExist ( urlList , bootProps . getInstallRoot ( ) + "/lib/bootstrap-agent.jar" ) ; Policy wlpPolicy = new WLPDynamicPolicy ( Policy . getPolicy ( ) , urlList ) ; Policy . setPolicy ( wlpPolicy ) ; } }
Set Java 2 Security if enabled
36,563
protected static String getProductInfoDisplayName ( ) { String result = null ; try { Map < String , ProductInfo > products = ProductInfo . getAllProductInfo ( ) ; StringBuilder builder = new StringBuilder ( ) ; for ( ProductInfo productInfo : products . values ( ) ) { ProductInfo replaced = productInfo . getReplacedBy ( ) ; if ( productInfo . getReplacedBy ( ) == null || replaced . isReplacedProductLogged ( ) ) { if ( builder . length ( ) != 0 ) { builder . append ( ", " ) ; } builder . append ( productInfo . getDisplayName ( ) ) ; } } result = builder . toString ( ) ; } catch ( ProductInfoParseException e ) { } catch ( DuplicateProductInfoException e ) { } catch ( ProductInfoReplaceException e ) { } return result ; }
Return a display name for the currently running server .
36,564
protected Instrumentation getInstrumentation ( ) { ClassLoader cl = ClassLoader . getSystemClassLoader ( ) ; Instrumentation i = findInstrumentation ( cl , "com.ibm.ws.kernel.instrument.BootstrapAgent" ) ; if ( i == null ) i = findInstrumentation ( cl , "wlp.lib.extract.agent.BootstrapAgent" ) ; return i ; }
Fetch the BootstrapAgent instrumentation instance from the BootstrapAgent in the system classloader .
36,565
public JspConfiguration createClonedJspConfiguration ( ) { return new JspConfiguration ( configManager , this . getServletVersion ( ) , this . jspVersion , this . isXml , this . isXmlSpecified , this . elIgnored , this . scriptingInvalid ( ) , this . isTrimDirectiveWhitespaces ( ) , this . isDeferredSyntaxAllowedAsLiteral ( ) , this . getTrimDirectiveWhitespaces ( ) , this . getDeferredSyntaxAllowedAsLiteral ( ) , this . elIgnoredSetTrueInPropGrp ( ) , this . elIgnoredSetTrueInPage ( ) , this . getDefaultContentType ( ) , this . getBuffer ( ) , this . isErrorOnUndeclaredNamespace ( ) ) ; }
This method is used for creating a configuration for a tag file . The tag file may want to override some properties if it s jsp version in the tld is different than the server version
36,566
public ExpressionFactory getExpressionFactory ( ) { synchronized ( this ) { if ( expressionFactory == null ) { expressionFactory = ExpressionFactory . newInstance ( ) ; } } if ( configManager . isJCDIEnabled ( ) ) { if ( jcdiWrappedExpressionFactory == null ) { ELFactoryWrapperForCDI wrapperExpressionFactory = JSPExtensionFactory . getWrapperExpressionFactory ( ) ; if ( wrapperExpressionFactory != null ) { jcdiWrappedExpressionFactory = ( ExpressionFactory ) wrapperExpressionFactory ; return jcdiWrappedExpressionFactory ; } } else { return jcdiWrappedExpressionFactory ; } } return expressionFactory ; }
LIDB4147 - 9 Begin
36,567
protected ClassInfoImpl getDelayableClassInfo ( Type type ) { String typeClassName = type . getClassName ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] ENTER [ {1} ] [ {2} ]" , new Object [ ] { getHashText ( ) , type , typeClassName } ) ) ; } ClassInfoImpl classInfo ; String classInfoCase ; int sort = type . getSort ( ) ; if ( sort == Type . ARRAY ) { classInfo = getArrayClassInfo ( typeClassName , type ) ; classInfoCase = "array class" ; } else if ( sort == Type . OBJECT ) { classInfo = getDelayableClassInfo ( typeClassName , DO_NOT_ALLOW_PRIMITIVE ) ; if ( classInfo . isJavaClass ( ) ) { if ( classInfo . isDelayedClass ( ) ) { classInfoCase = "java delayed" ; } else { classInfoCase = "java non-delayed" ; } } else { if ( classInfo . isDelayedClass ( ) ) { classInfoCase = "non-java delayed" ; } else { classInfoCase = "non-java non-delayed" ; } } } else { classInfo = getPrimitiveClassInfo ( typeClassName , type ) ; classInfoCase = "primitive class" ; } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] RETURN [ {1} ] [ {2} ]" , new Object [ ] { getHashText ( ) , classInfo . getHashText ( ) , classInfoCase } ) ) ; } return classInfo ; }
For array types the previous implementation used the element name .
36,568
public ArrayClassInfo getArrayClassInfo ( String typeClassName , Type arrayType ) { ClassInfoImpl elementClassInfo = getDelayableClassInfo ( arrayType . getElementType ( ) ) ; return new ArrayClassInfo ( typeClassName , elementClassInfo ) ; }
Note that this will recurse as long as the element type is still an array type .
36,569
protected boolean addClassInfo ( NonDelayedClassInfo classInfo ) { boolean didAdd ; if ( classInfo . isJavaClass ( ) ) { didAdd = basicPutJavaClassInfo ( classInfo ) ; } else if ( classInfo . isAnnotationPresent ( ) || classInfo . isFieldAnnotationPresent ( ) || classInfo . isMethodAnnotationPresent ( ) ) { didAdd = basicPutAnnotatedClassInfo ( classInfo ) ; } else { didAdd = basicPutClassInfo ( classInfo ) ; if ( didAdd ) { addAsFirst ( classInfo ) ; } } if ( didAdd ) { ClassInfoImpl delayedClassInfo = associate ( classInfo ) ; discardRef ( delayedClassInfo ) ; } return didAdd ; }
Do update the LRU state .
36,570
protected void addAsFirst ( NonDelayedClassInfo classInfo ) { String methodName = "addAsFirst" ; boolean doLog = tc . isDebugEnabled ( ) ; String useHashText = ( doLog ? getHashText ( ) : null ) ; String useClassHashText = ( doLog ? classInfo . getHashText ( ) : null ) ; if ( doLog ) { logLinks ( methodName , classInfo ) ; } if ( firstClassInfo == null ) { if ( doLog ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Adding [ {1} ] to empty" , new Object [ ] { useHashText , useClassHashText } ) ) ; } firstClassInfo = classInfo ; lastClassInfo = classInfo ; } else if ( firstClassInfo == lastClassInfo ) { if ( doLog ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Adding [ {1} ] to singleton [ {2} ]" , new Object [ ] { useHashText , useClassHashText , firstClassInfo . getHashText ( ) } ) ) ; } firstClassInfo = classInfo ; firstClassInfo . setNextClassInfo ( lastClassInfo ) ; lastClassInfo . setPriorClassInfo ( classInfo ) ; } else { if ( doLog ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Adding [ {1} ] to multitude [ {2} ]" , new Object [ ] { useHashText , useClassHashText , firstClassInfo . getHashText ( ) } ) ) ; } classInfo . setNextClassInfo ( firstClassInfo ) ; firstClassInfo . setPriorClassInfo ( classInfo ) ; firstClassInfo = classInfo ; if ( classInfos . size ( ) > ClassInfoCache . classInfoCacheLimit ) { NonDelayedClassInfo oldLastClassInfo = lastClassInfo ; String lastClassName = lastClassInfo . getName ( ) ; classInfos . remove ( lastClassName ) ; discardRef ( lastClassName ) ; lastClassInfo = oldLastClassInfo . getPriorClassInfo ( ) ; lastClassInfo . setNextClassInfo ( null ) ; oldLastClassInfo . setPriorClassInfo ( null ) ; if ( doLog ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] new last [ {1} ] displaces [ {2} ]" , new Object [ ] { useHashText , lastClassInfo . getHashText ( ) , oldLastClassInfo . getHashText ( ) } ) ) ; } DelayedClassInfo delayedClassInfo = oldLastClassInfo . getDelayedClassInfo ( ) ; if ( delayedClassInfo != null ) { if ( doLog ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Clearing link on displaced [ {1} ]" , new Object [ ] { useHashText , oldLastClassInfo . getHashText ( ) } ) ) ; } delayedClassInfo . setClassInfo ( null ) ; oldLastClassInfo . setDelayedClassInfo ( null ) ; } } } }
put us over the maximum size trim off the last element .
36,571
public void makeFirst ( NonDelayedClassInfo classInfo ) { String methodName = "makeFirst" ; boolean doLog = tc . isDebugEnabled ( ) ; String useHashText = ( doLog ? getHashText ( ) : null ) ; String useClassHashText = ( doLog ? classInfo . getHashText ( ) : null ) ; if ( doLog ) { logLinks ( methodName , classInfo ) ; } if ( classInfo == firstClassInfo ) { if ( doLog ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Already first [ {1} ]" , new Object [ ] { useHashText , useClassHashText } ) ) ; } return ; } else if ( classInfo == lastClassInfo ) { if ( doLog ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Moving from last [ {1} ]" , new Object [ ] { useHashText , useClassHashText } ) ) ; Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Old first [ {1} ]" , new Object [ ] { useHashText , firstClassInfo . getHashText ( ) } ) ) ; } lastClassInfo = classInfo . getPriorClassInfo ( ) ; lastClassInfo . setNextClassInfo ( null ) ; if ( doLog ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] New last [ {1} ]" , new Object [ ] { useHashText , lastClassInfo . getHashText ( ) } ) ) ; } firstClassInfo . setPriorClassInfo ( classInfo ) ; classInfo . setPriorClassInfo ( null ) ; classInfo . setNextClassInfo ( firstClassInfo ) ; firstClassInfo = classInfo ; } else { if ( doLog ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Moving from middle [ {1} ]" , new Object [ ] { useHashText , useClassHashText } ) ) ; Tr . debug ( tc , MessageFormat . format ( "[ {0} ] Old first [ {1} ]" , new Object [ ] { useHashText , firstClassInfo . getHashText ( ) } ) ) ; } NonDelayedClassInfo currentPrior = classInfo . getPriorClassInfo ( ) ; NonDelayedClassInfo currentNext = classInfo . getNextClassInfo ( ) ; currentPrior . setNextClassInfo ( currentNext ) ; currentNext . setPriorClassInfo ( currentPrior ) ; firstClassInfo . setPriorClassInfo ( classInfo ) ; classInfo . setNextClassInfo ( firstClassInfo ) ; classInfo . setPriorClassInfo ( null ) ; firstClassInfo = classInfo ; } }
The class info is last or the class info is somewhere in the middle .
36,572
@ FFDCIgnore ( MalformedURLException . class ) public URL getResource ( ) { String useRelPath = getRelativePath ( ) ; if ( ( zipEntryData == null ) || zipEntryData . isDirectory ( ) ) { useRelPath += "/" ; } URI entryUri = rootContainer . createEntryUri ( useRelPath ) ; if ( entryUri == null ) { return null ; } try { return entryUri . toURL ( ) ; } catch ( MalformedURLException e ) { if ( FrameworkState . isStopping ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "MalformedURLException during OSGi framework stop." , e . getMessage ( ) ) ; } else { FFDCFilter . processException ( e , getClass ( ) . getName ( ) , "269" ) ; } } return null ; } }
Answer the URL of this entry .
36,573
public InputStream getInputStream ( ) throws IOException { if ( ( zipEntryData == null ) || zipEntryData . isDirectory ( ) ) { return null ; } final ZipFileHandle zipFileHandle = rootContainer . getZipFileHandle ( ) ; ZipFile zipFile = zipFileHandle . open ( ) ; final InputStream baseInputStream ; try { baseInputStream = zipFileHandle . getInputStream ( zipFile , zipEntryData . getPath ( ) ) ; } catch ( Throwable th ) { zipFileHandle . close ( ) ; throw th ; } if ( baseInputStream == null ) { throw new FileNotFoundException ( "Zip file [ " + zipFile . getName ( ) + " ]" + " failed to provide input stream for entry [ " + zipEntryData . getPath ( ) + " ]" ) ; } InputStream inputStream = new InputStream ( ) { private final InputStream wrappedInputStream = baseInputStream ; public synchronized void finalize ( ) throws Throwable { close ( ) ; super . finalize ( ) ; } private volatile boolean isClosed ; public void close ( ) throws IOException { if ( ! isClosed ) { synchronized ( this ) { if ( ! isClosed ) { try { wrappedInputStream . close ( ) ; } catch ( IOException e ) { } zipFileHandle . close ( ) ; isClosed = true ; } } } } public int read ( byte [ ] b ) throws IOException { return wrappedInputStream . read ( b ) ; } public int read ( byte [ ] b , int off , int len ) throws IOException { return wrappedInputStream . read ( b , off , len ) ; } public long skip ( long n ) throws IOException { return wrappedInputStream . skip ( n ) ; } public int available ( ) throws IOException { return wrappedInputStream . available ( ) ; } @ SuppressWarnings ( "sync-override" ) public void mark ( int readlimit ) { wrappedInputStream . mark ( readlimit ) ; } @ SuppressWarnings ( "sync-override" ) public void reset ( ) throws IOException { wrappedInputStream . reset ( ) ; } public boolean markSupported ( ) { return wrappedInputStream . markSupported ( ) ; } public int read ( ) throws IOException { return wrappedInputStream . read ( ) ; } } ; return inputStream ; }
Obtain an input stream for the entry .
36,574
public ArtifactContainer getEnclosingContainer ( ) { if ( enclosingContainer == null ) { synchronized ( this ) { if ( enclosingContainer == null ) { String a_enclosingPath = PathUtils . getParent ( a_path ) ; int parentLen = a_enclosingPath . length ( ) ; if ( parentLen == 1 ) { enclosingContainer = rootContainer ; } else { String r_enclosingPath = a_enclosingPath . substring ( 1 ) ; int lastSlash = r_enclosingPath . lastIndexOf ( '/' ) ; String enclosingName ; if ( lastSlash == - 1 ) { enclosingName = r_enclosingPath ; } else { enclosingName = r_enclosingPath . substring ( lastSlash + 1 ) ; } ZipFileEntry entryInEnclosingContainer = rootContainer . createEntry ( enclosingName , a_enclosingPath ) ; enclosingContainer = entryInEnclosingContainer . convertToLocalContainer ( ) ; } } } } return enclosingContainer ; }
Answer the enclosing container of this entry .
36,575
public char normalize ( char currentChar ) { if ( NORMALIZE_UPPER == getNormalization ( ) ) { return toUpper ( currentChar ) ; } if ( NORMALIZE_LOWER == getNormalization ( ) ) { return toLower ( currentChar ) ; } return currentChar ; }
Take the input character and normalize based on this normalizer instance .
36,576
static public char normalize ( char input , int format ) { if ( NORMALIZE_LOWER == format ) { return toLower ( input ) ; } if ( NORMALIZE_UPPER == format ) { return toUpper ( input ) ; } return input ; }
Take the input character and normalize based on the input format .
36,577
public void init ( IFilterConfig filterConfig ) throws ServletException { try { _filterState = FILTER_STATE_INITIALIZING ; this . _filterConfig = filterConfig ; if ( _eventSource != null && _eventSource . hasFilterListeners ( ) ) { _eventSource . onFilterStartInit ( getFilterEvent ( ) ) ; _filterInstance . init ( filterConfig ) ; _eventSource . onFilterFinishInit ( getFilterEvent ( ) ) ; } else { _filterInstance . init ( filterConfig ) ; } _filterState = FILTER_STATE_AVAILABLE ; } catch ( Throwable th ) { if ( _eventSource != null && _eventSource . hasFilterErrorListeners ( ) ) { FilterErrorEvent errorEvent = getFilterErrorEvent ( th ) ; _eventSource . onFilterInitError ( errorEvent ) ; } com . ibm . wsspi . webcontainer . util . FFDCWrapper . processException ( th , "com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init" , "111" , this ) ; _filterState = FILTER_STATE_UNAVAILABLE ; throw new ServletException ( MessageFormat . format ( "Filter [{0}]: could not be initialized" , new Object [ ] { _filterName } ) , th ) ; } }
Initializes the filter wrapper and the underlying filter instance
36,578
public void destroy ( ) throws ServletException { try { _filterState = FILTER_STATE_DESTROYING ; for ( int i = 0 ; ( nServicing . get ( ) > 0 ) && i < 60 ; i ++ ) { try { if ( i == 0 ) { logger . logp ( Level . INFO , CLASS_NAME , "destroy" , "waiting.to.destroy.filter.[{0}]" , _filterName ) ; } Thread . sleep ( 1000 ) ; } catch ( InterruptedException e ) { com . ibm . wsspi . webcontainer . util . FFDCWrapper . processException ( e , "com.ibm.ws.webcontainer.servlet.ServletInstance.destroy" , "377" , this ) ; } } if ( _eventSource != null && _eventSource . hasFilterListeners ( ) ) { _eventSource . onFilterStartDestroy ( getFilterEvent ( ) ) ; _filterInstance . destroy ( ) ; _eventSource . onFilterFinishDestroy ( getFilterEvent ( ) ) ; } else { _filterInstance . destroy ( ) ; } _filterState = FILTER_STATE_DESTROYED ; if ( null != _managedObject ) { _managedObject . release ( ) ; } } catch ( Throwable th ) { if ( _eventSource != null && _eventSource . hasFilterErrorListeners ( ) ) { FilterErrorEvent errorEvent = getFilterErrorEvent ( th ) ; _eventSource . onFilterDestroyError ( errorEvent ) ; } com . ibm . wsspi . webcontainer . util . FFDCWrapper . processException ( th , "com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.destroy" , "173" , this ) ; _filterState = FILTER_STATE_UNAVAILABLE ; throw new ServletException ( MessageFormat . format ( "Filter [{0}]: could not be destroyed" , new Object [ ] { _filterName } ) , th ) ; } }
Destroys the filter wrapper and the underlying filter instance
36,579
protected synchronized void activate ( ComponentContext cc ) { pipelineRef . activate ( cc ) ; securityServiceRef . activate ( cc ) ; insertJMXSecurityFilter ( ) ; }
Insert the JMX security filter upon activation . This will only happen if we have both the MBeanServerPipeline and the SecurityService .
36,580
protected synchronized void deactivate ( ComponentContext cc ) { removeJMXSecurityFilter ( ) ; pipelineRef . deactivate ( cc ) ; securityServiceRef . deactivate ( cc ) ; }
Remove the JMX security filter upon deactivation .
36,581
private void throwAuthzException ( ) throws SecurityException { SubjectManager subjectManager = new SubjectManager ( ) ; String name = "UNAUTHENTICATED" ; if ( subjectManager . getInvocationSubject ( ) != null ) { name = subjectManager . getInvocationSubject ( ) . getPrincipals ( ) . iterator ( ) . next ( ) . getName ( ) ; } Tr . audit ( tc , "MANAGEMENT_SECURITY_AUTHZ_FAILED" , name , "MBeanAccess" , requiredRoles ) ; String message = Tr . formatMessage ( tc , "MANAGEMENT_SECURITY_AUTHZ_FAILED" , name , "MBeanAccess" , requiredRoles ) ; throw new SecurityException ( message ) ; }
Throwing a SecurityException as not all of the methods that need protection throw an MBeanException . We can change this if we need to .
36,582
protected void setupNotificationArea ( ) throws Throwable { final String sourceMethod = "setupNotificationArea" ; URL notificationsURL = null ; HttpsURLConnection connection = null ; try { notificationsURL = serverConnection . getNotificationsURL ( ) ; if ( logger . isLoggable ( Level . FINEST ) ) { logger . logp ( Level . FINEST , logger . getName ( ) , sourceMethod , "[" + RESTClientMessagesUtil . getObjID ( this ) + "] About to call notificationURL: " + notificationsURL ) ; } connection = serverConnection . getConnection ( notificationsURL , HttpMethod . POST , true ) ; NotificationSettings ns = new NotificationSettings ( ) ; ns . deliveryInterval = serverConnection . getConnector ( ) . getNotificationDeliveryInterval ( ) ; ns . inboxExpiry = serverConnection . getConnector ( ) . getNotificationInboxExpiry ( ) ; OutputStream output = connection . getOutputStream ( ) ; converter . writeNotificationSettings ( output , ns ) ; output . flush ( ) ; } catch ( ConnectException ce ) { throw ce ; } catch ( IOException io ) { throw serverConnection . getRequestErrorException ( sourceMethod , io , notificationsURL ) ; } final int responseCode = connection . getResponseCode ( ) ; if ( logger . isLoggable ( Level . FINEST ) ) { logger . logp ( Level . FINEST , logger . getName ( ) , sourceMethod , "Received responseCode: " + responseCode ) ; } switch ( responseCode ) { case HttpURLConnection . HTTP_OK : JSONConverter converter = JSONConverter . getConverter ( ) ; try { NotificationArea area = converter . readNotificationArea ( connection . getInputStream ( ) ) ; inboxURL = new DynamicURL ( serverConnection . connector , area . inboxURL ) ; registrationsURL = new DynamicURL ( serverConnection . connector , area . registrationsURL ) ; serverRegistrationsURL = new DynamicURL ( serverConnection . connector , area . serverRegistrationsURL ) ; notificationClientURL = new DynamicURL ( serverConnection . connector , area . clientURL ) ; if ( logger . isLoggable ( Level . FINER ) ) { logger . logp ( Level . FINER , logger . getName ( ) , "setupNotificationArea" , "Successfully setup inboxURL: " + inboxURL . getURL ( ) ) ; } break ; } catch ( Exception e ) { throw serverConnection . getResponseErrorException ( sourceMethod , e , notificationsURL ) ; } finally { JSONConverter . returnConverter ( converter ) ; } case HttpURLConnection . HTTP_NOT_FOUND : throw new IOException ( RESTClientMessagesUtil . getMessage ( RESTClientMessagesUtil . URL_NOT_FOUND ) ) ; case HttpURLConnection . HTTP_UNAVAILABLE : case HttpURLConnection . HTTP_BAD_REQUEST : case HttpURLConnection . HTTP_INTERNAL_ERROR : throw serverConnection . getServerThrowable ( sourceMethod , connection ) ; case HttpURLConnection . HTTP_UNAUTHORIZED : case HttpURLConnection . HTTP_FORBIDDEN : throw serverConnection . getBadCredentialsException ( responseCode , connection ) ; default : throw serverConnection . getResponseCodeErrorException ( sourceMethod , responseCode , connection ) ; } }
we want to avoid cycles .
36,583
private void sendClosingSignal ( ) { URL clientURL = null ; HttpsURLConnection connection = null ; try { if ( serverConnection . serverVersion >= 4 ) { clientURL = getNotificationClientURL ( ) ; } else { clientURL = getInboxURL ( ) ; } if ( logger . isLoggable ( Level . FINEST ) ) { logger . logp ( Level . FINEST , logger . getName ( ) , "sendClosingSignal" , "Making a call to delete inbox [" + clientURL + "] from [" + RESTClientMessagesUtil . getObjID ( this ) + "]" ) ; } connection = serverConnection . getConnection ( clientURL , HttpMethod . DELETE , true ) ; connection . setReadTimeout ( serverConnection . getConnector ( ) . getReadTimeout ( ) ) ; int responseCode = 0 ; try { responseCode = connection . getResponseCode ( ) ; } catch ( ConnectException ce ) { logger . logp ( Level . FINE , logger . getName ( ) , "sendClosingSignal" , ce . getMessage ( ) , ce ) ; } if ( logger . isLoggable ( Level . FINEST ) ) { logger . logp ( Level . FINEST , logger . getName ( ) , "sendClosingSignal" , "Response code: " + responseCode ) ; } } catch ( IOException io ) { logger . logp ( Level . FINE , logger . getName ( ) , "sendClosingSignal" , io . getMessage ( ) , io ) ; } }
We don t throw any errors because the connector is about to be closed .
36,584
private static Type getAsynchronizedGenericType ( Object targetObject ) { if ( targetObject instanceof java . util . Collection ) { Class < ? extends java . util . Collection > rawType = ( Class < ? extends Collection > ) targetObject . getClass ( ) ; Class < ? > actualType = Object . class ; if ( ( ( java . util . Collection < ? > ) targetObject ) . size ( ) > 0 ) { Object element = ( ( java . util . Collection < ? > ) targetObject ) . iterator ( ) . next ( ) ; actualType = element . getClass ( ) ; } return new ParameterizedType ( ) { private Type actualType , rawType ; public ParameterizedType setTypes ( Type actualType , Type rawType ) { this . actualType = actualType ; this . rawType = rawType ; return this ; } public Type [ ] getActualTypeArguments ( ) { return new Type [ ] { actualType } ; } public Type getRawType ( ) { return rawType ; } public Type getOwnerType ( ) { return null ; } } . setTypes ( actualType , rawType ) ; } else return targetObject . getClass ( ) ; }
Hack to generate a type class for collection object .
36,585
public synchronized FailureScope currentFailureScope ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "currentFailureScope" , this ) ; if ( _currentFailureScope == null ) { _currentFailureScope = new FileFailureScope ( ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "currentFailureScope" , _currentFailureScope ) ; return _currentFailureScope ; }
Invoked by a client service to determine the current FailureScope . This is defined as a FailureScope that identifies the current point of execution . In practice this means the current server on distributed or server region on 390 .
36,586
public void directInitialization ( FailureScope failureScope ) throws RecoveryFailedException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "directInitialization" , new Object [ ] { failureScope , this } ) ; final FailureScope currentFailureScope = Configuration . localFailureScope ( ) ; synchronized ( _registeredRecoveryAgents ) { _registrationAllowed = false ; } if ( currentFailureScope . equals ( failureScope ) ) { Tr . info ( tc , "CWRLS0010_PERFORM_LOCAL_RECOVERY" , failureScope . serverName ( ) ) ; } else { Tr . info ( tc , "CWRLS0011_PERFORM_PEER_RECOVERY" , failureScope . serverName ( ) ) ; } final Collection registeredRecoveryAgentsValues = _registeredRecoveryAgents . values ( ) ; Iterator registeredRecoveryAgentsValuesIterator = registeredRecoveryAgentsValues . iterator ( ) ; while ( registeredRecoveryAgentsValuesIterator . hasNext ( ) ) { final ArrayList registeredRecoveryAgentsArray = ( java . util . ArrayList ) registeredRecoveryAgentsValuesIterator . next ( ) ; final Iterator registeredRecoveryAgentsArrayIterator = registeredRecoveryAgentsArray . iterator ( ) ; while ( registeredRecoveryAgentsArrayIterator . hasNext ( ) ) { final RecoveryAgent recoveryAgent = ( RecoveryAgent ) registeredRecoveryAgentsArrayIterator . next ( ) ; recoveryAgent . prepareForRecovery ( failureScope ) ; addInitializationRecord ( recoveryAgent , failureScope ) ; addRecoveryRecord ( recoveryAgent , failureScope ) ; } } if ( Configuration . HAEnabled ( ) ) { Configuration . getRecoveryLogComponent ( ) . joinCluster ( failureScope ) ; } if ( _registeredCallbacks != null ) { driveCallBacks ( CALLBACK_RECOVERYSTARTED , failureScope ) ; } registeredRecoveryAgentsValuesIterator = registeredRecoveryAgentsValues . iterator ( ) ; while ( registeredRecoveryAgentsValuesIterator . hasNext ( ) ) { final ArrayList registeredRecoveryAgentsArray = ( java . util . ArrayList ) registeredRecoveryAgentsValuesIterator . next ( ) ; final Iterator registeredRecoveryAgentsArrayIterator = registeredRecoveryAgentsArray . iterator ( ) ; while ( registeredRecoveryAgentsArrayIterator . hasNext ( ) ) { final RecoveryAgent recoveryAgent = ( RecoveryAgent ) registeredRecoveryAgentsArrayIterator . next ( ) ; try { _eventListeners . clientRecoveryInitiated ( failureScope , recoveryAgent . clientIdentifier ( ) ) ; recoveryAgent . initiateRecovery ( failureScope ) ; } catch ( RecoveryFailedException exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl.directInitialization" , "410" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "directInitialization" , exc ) ; throw exc ; } synchronized ( _outstandingInitializationRecords ) { while ( initializationOutstanding ( recoveryAgent , failureScope ) ) { try { _outstandingInitializationRecords . wait ( ) ; } catch ( InterruptedException exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl.directInitialization" , "432" , this ) ; } } } } } if ( currentFailureScope . equals ( failureScope ) ) { Tr . info ( tc , "CWRLS0012_DIRECT_LOCAL_RECOVERY" , failureScope . serverName ( ) ) ; } else { Tr . info ( tc , "CWRLS0013_DIRECT_PEER_RECOVERY" , failureScope . serverName ( ) ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "directInitialization" ) ; }
Internal method to initiate recovery processing of the given FailureScope . All registered RecoveryAgent objects will be directed to process the FailureScope in sequence .
36,587
public void directTermination ( FailureScope failureScope ) throws TerminationFailedException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "directTermination" , new Object [ ] { failureScope , this } ) ; Tr . info ( tc , "CWRLS0014_HALT_PEER_RECOVERY" , failureScope . serverName ( ) ) ; if ( _registeredCallbacks != null ) { driveCallBacks ( CALLBACK_TERMINATIONSTARTED , failureScope ) ; } if ( Configuration . HAEnabled ( ) ) { Configuration . getRecoveryLogComponent ( ) . leaveCluster ( failureScope ) ; } final Collection registeredRecoveryAgentsValues = _registeredRecoveryAgents . values ( ) ; final Iterator registeredRecoveryAgentsValuesIterator = registeredRecoveryAgentsValues . iterator ( ) ; while ( registeredRecoveryAgentsValuesIterator . hasNext ( ) ) { final ArrayList registeredRecoveryAgentsArray = ( java . util . ArrayList ) registeredRecoveryAgentsValuesIterator . next ( ) ; final Iterator registeredRecoveryAgentsArrayIterator = registeredRecoveryAgentsArray . iterator ( ) ; while ( registeredRecoveryAgentsArrayIterator . hasNext ( ) ) { final RecoveryAgent recoveryAgent = ( RecoveryAgent ) registeredRecoveryAgentsArrayIterator . next ( ) ; addTerminationRecord ( recoveryAgent , failureScope ) ; try { recoveryAgent . terminateRecovery ( failureScope ) ; } catch ( TerminationFailedException exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl.directTermination" , "540" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "directTermination" , exc ) ; throw exc ; } catch ( Exception exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl.directTermination" , "576" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "directTermination" , exc ) ; throw new TerminationFailedException ( exc ) ; } synchronized ( _outstandingTerminationRecords ) { while ( terminationOutstanding ( recoveryAgent , failureScope ) ) { try { _outstandingTerminationRecords . wait ( ) ; } catch ( InterruptedException exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.recoverylog.spi.RecoveryDirectorImpl.directTermination" , "549" , this ) ; } } } } } if ( _registeredCallbacks != null ) { driveCallBacks ( CALLBACK_TERMINATIONCOMPLETE , failureScope ) ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "directTermination" ) ; }
Internal method to terminate recovery processing of the given FailureScope . All registered RecoveryAgent objects will be directed to terminate processing of the FailureScopein sequence .
36,588
public void registerRecoveryEventListener ( RecoveryEventListener rel ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "registerRecoveryEventListener" , rel ) ; RegisteredRecoveryEventListeners . instance ( ) . add ( rel ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "registerRecoveryEventListener" ) ; }
Register the recovery event callback listener .
36,589
public boolean isHAEnabled ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "isHAEnabled" ) ; final boolean haEnabled = Configuration . HAEnabled ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "isHAEnabled" , haEnabled ) ; return haEnabled ; }
This method allows a client service to determine if High Availability support has been enabled for the local cluster .
36,590
public void registerCallback ( UOWScopeCallback callback ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "registerCallback" , new Object [ ] { callback , this } ) ; _callbackManager . addCallback ( callback ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "registerCallback" ) ; }
Register users who want notification on UserTransaction Begin and End
36,591
public void unregisterCallback ( UOWScopeCallback callback ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "unregisterCallback" , new Object [ ] { callback , this } ) ; _callbackManager . removeCallback ( callback ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "unregisterCallback" ) ; }
unregister users who want notification on UserTransaction Begin and End
36,592
private void connectCommon ( Object _udpRequestContextObject ) throws IOException { String localAddress = "*" ; int localPort = 0 ; Map < Object , Object > vcStateMap = getVirtualConnection ( ) . getStateMap ( ) ; if ( vcStateMap != null ) { String value = ( String ) vcStateMap . get ( UDPConfigConstants . CHANNEL_RCV_BUFF_SIZE ) ; if ( value != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , UDPConfigConstants . CHANNEL_RCV_BUFF_SIZE + " " + value ) ; } cfg . setChannelReceiveBufferSize ( Integer . parseInt ( value ) ) ; } value = ( String ) vcStateMap . get ( UDPConfigConstants . RCV_BUFF_SIZE ) ; if ( value != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , UDPConfigConstants . RCV_BUFF_SIZE + " " + value ) ; } cfg . setReceiveBufferSize ( Integer . parseInt ( value ) ) ; } value = ( String ) vcStateMap . get ( UDPConfigConstants . SEND_BUFF_SIZE ) ; if ( value != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , UDPConfigConstants . SEND_BUFF_SIZE + " " + value ) ; } cfg . setSendBufferSize ( Integer . parseInt ( value ) ) ; } } if ( _udpRequestContextObject != null ) { final UDPRequestContext udpRequestContext = ( UDPRequestContext ) _udpRequestContextObject ; final InetSocketAddress addr = udpRequestContext . getLocalAddress ( ) ; localAddress = addr . getAddress ( ) . getHostAddress ( ) ; localPort = addr . getPort ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "connect with local address: " + localAddress + " local port: " + localPort ) ; } } udpNetworkLayer = new UDPNetworkLayer ( udpChannel , workQueueMgr , localAddress , localPort ) ; udpNetworkLayer . initDatagramSocket ( getVirtualConnection ( ) ) ; udpNetworkLayer . setConnLink ( this ) ; }
Common connect logic between sync and async connect requests .
36,593
public String retrieveEndpointName ( J2EEName j2eeName ) { for ( Entry < String , J2EEName > entry : endpointNameJ2EENameMap . entrySet ( ) ) { if ( entry . getValue ( ) . equals ( j2eeName ) ) { return entry . getKey ( ) ; } } return null ; }
Get the endpoint name by j2eeName
36,594
private final void _tryUnlink ( ) { if ( 0 >= _cursorCount && _state == LOGICALLY_UNLINKED ) { _previousLink . _nextLink = _nextLink ; _nextLink . _previousLink = _previousLink ; _previousLink = null ; _nextLink = null ; _state = PHYSICALLY_UNLINKED ; } }
Attempt to physically unlink the receiver if appropriate . MUST BE CALLED UNDER _parent MONITOR .
36,595
public final Link getNextLink ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "getNextLink" , _positionString ( ) ) ; } Link nextLink = null ; LinkedList parent = _parent ; if ( null != parent ) { nextLink = _parent . getNextLink ( this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( this , tc , "getNextLink" , nextLink ) ; } return nextLink ; }
Navigate to the next logical link . This version is for use with non - cursored navigation .
36,596
public void xmlWriteOn ( FormattedWriter writer ) throws IOException { String name = "link" ; writer . write ( "<" ) ; writer . write ( name ) ; xmlWriteAttributesOn ( writer ) ; writer . write ( " />" ) ; }
Default XML output .
36,597
@ SuppressWarnings ( "rawtypes" ) public void doPostConstruct ( Class clazz , List < LifecycleCallback > postConstructs ) throws InjectionException { mainClassName = clazz . getName ( ) ; doPostConstruct ( clazz , postConstructs , null ) ; }
Processes the PostConstruct callback method for the application main class
36,598
public void doPostConstruct ( Object instance , List < LifecycleCallback > postConstructs ) throws InjectionException { doPostConstruct ( instance . getClass ( ) , postConstructs , instance ) ; }
Processes the PostConstruct callback method for the login callback handler class
36,599
public void doPreDestroy ( Object instance , List < LifecycleCallback > preDestroy ) throws InjectionException { doPreDestroy ( instance . getClass ( ) , preDestroy , instance ) ; }
Processes the PreDestroy callback method for the login callback handler class