idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
24,500 | public IJobXMLSource loadJSL ( String id ) { IJobXMLSource jobXML = loadJobFromDirectory ( JOB_XML_PATH , id ) ; return jobXML ; } | Assuming we get around to supporting this we want to improve the servicability with better exception handling . |
24,501 | @ FFDCIgnore ( IllegalArgumentException . class ) private String evaluateDataSourceLookup ( boolean immediateOnly ) { try { return elHelper . processString ( "dataSourceLookup" , idStoreDefinition . dataSourceLookup ( ) , immediateOnly ) ; } catch ( IllegalArgumentException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "JAVAEESEC_WARNING_IDSTORE_CONFIG" , new Object [ ] { "dataSourceLookup" , "java:comp/DefaultDataSource" } ) ; } return "java:comp/DefaultDataSource" ; } } | Evaluate and return the dataSourceLookup . |
24,502 | @ FFDCIgnore ( IllegalArgumentException . class ) private List < String > evaluateHashAlgorithmParameters ( ) { List < String > parameters = new ArrayList < String > ( ) ; String [ ] rawArray = idStoreDefinition . hashAlgorithmParameters ( ) ; if ( rawArray == null || rawArray . length == 0 ) { return parameters ; } if ( rawArray . length == 1 ) { try { String value = elHelper . processString ( "hashAlgorithmParameters[0]" , rawArray [ 0 ] , false ) ; if ( value != null && ! value . isEmpty ( ) ) { parameters . add ( value ) ; } return parameters ; } catch ( IllegalArgumentException e ) { } try { String [ ] array = elHelper . processStringArray ( "hashAlgorithmParameters[0]" , rawArray [ 0 ] , false , false ) ; if ( array != null && array . length == 0 ) { for ( String value : array ) { if ( value != null && ! value . isEmpty ( ) ) { parameters . add ( value ) ; } } } return parameters ; } catch ( IllegalArgumentException e ) { } try { Stream < String > stream = elHelper . processStringStream ( "hashAlgorithmParameters[0]" , rawArray [ 0 ] , false , false ) ; Iterator < String > iterator = stream . iterator ( ) ; while ( iterator . hasNext ( ) ) { String value = iterator . next ( ) ; if ( value != null && ! value . isEmpty ( ) ) { parameters . add ( value ) ; } } return parameters ; } catch ( IllegalArgumentException e ) { } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isWarningEnabled ( ) ) { Tr . warning ( tc , "JAVAEESEC_WARNING_IDSTORE_CONFIG" , new Object [ ] { "hashAlgorithmParameters[0]" , Collections . emptyList ( ) } ) ; } } else { if ( rawArray != null && rawArray . length > 0 ) { for ( int idx = 0 ; idx < rawArray . length ; idx ++ ) { String value = elHelper . processString ( "hashAlgorithmParameters[" + idx + "]" , rawArray [ idx ] , false ) ; if ( value != null && ! value . isEmpty ( ) ) { parameters . add ( value ) ; } } } } return parameters ; } | Evaluate and return the hashAlgorithmParameters . |
24,503 | public boolean isMember ( Principal member ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "isMember" , "is: " + member + ", a member of: " + this ) ; boolean result = false ; if ( member instanceof MPPrincipal ) { List theGroups = ( ( MPPrincipal ) member ) . getGroups ( ) ; if ( theGroups != null ) result = theGroups . contains ( getName ( ) ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "isMember" , new Boolean ( result ) ) ; return result ; } | Returns true if the passed principal is a member of the group . This method does a recursive search so if a principal belongs to a group which is a member of this group true is returned . |
24,504 | public NotificationArea createNotificationArea ( RESTRequest request , String basePath , NotificationSettings notificationSettings ) { cleanUp ( request ) ; int clientID = getNewClientID ( ) ; ClientNotificationArea newInbox = new ClientNotificationArea ( notificationSettings . deliveryInterval , notificationSettings . inboxExpiry , clientID ) ; inboxes . put ( clientID , newInbox ) ; NotificationArea newArea = new NotificationArea ( ) ; newArea . clientURL = basePath + clientID ; newArea . inboxURL = newArea . clientURL + "/inbox" ; newArea . registrationsURL = newArea . clientURL + "/registrations" ; newArea . serverRegistrationsURL = newArea . clientURL + "/serverRegistrations" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Created notification area for client ID " + clientID ) ; } return newArea ; } | Creates a new clientID inbox and NotificationArea |
24,505 | public String addClientNotification ( RESTRequest request , int clientID , NotificationRegistration notificationRegistration , JSONConverter converter ) { ClientNotificationArea clientArea = getInboxIfAvailable ( clientID , converter ) ; clientArea . addClientNotificationListener ( request , notificationRegistration , converter ) ; String encodedObjectName = null ; try { encodedObjectName = URLEncoder . encode ( notificationRegistration . objectName . getCanonicalName ( ) , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { throw ErrorHelper . createRESTHandlerJsonException ( e , converter , APIConstants . STATUS_INTERNAL_SERVER_ERROR ) ; } String registrationURL = APIConstants . JMX_CONNECTOR_API_ROOT_PATH + "/notifications/" + clientID + "/registrations/" + encodedObjectName ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Client[" + clientID + "] registered a client-side notification for ObjectName " + notificationRegistration . objectName . getCanonicalName ( ) ) ; } return registrationURL ; } | Add a new client notification for the given client |
24,506 | public void removeClientNotification ( RESTRequest request , ObjectName objectName , int clientID ) { ClientNotificationArea clientArea = getInboxIfAvailable ( clientID , null ) ; clientArea . removeClientNotificationListener ( request , objectName ) ; } | Removes a corresponding client notification for the given ObjectName |
24,507 | public NotificationRecord [ ] getClientInbox ( int clientID ) { ClientNotificationArea inbox = getInboxIfAvailable ( clientID , null ) ; return inbox . fetchNotifications ( ) ; } | Retrieve the list of client notifications |
24,508 | public void handleServerNotificationRegistration ( RESTRequest request , int clientID , ServerNotificationRegistration serverNotificationRegistration , JSONConverter converter ) { ClientNotificationArea clientArea = getInboxIfAvailable ( clientID , converter ) ; if ( serverNotificationRegistration . operation == Operation . RemoveAll ) { clientArea . removeServerNotificationListener ( request , serverNotificationRegistration , true , converter , false ) ; } else { if ( serverNotificationRegistration . operation == Operation . Add ) { clientArea . addServerNotificationListener ( request , serverNotificationRegistration , converter ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Added server-side notification" ) ; } } else { clientArea . removeServerNotificationListener ( request , serverNotificationRegistration , false , converter , false ) ; } } } | Handle a server notification registration . This method is only invoked by our java client . |
24,509 | public String addServerNotificationHTTP ( RESTRequest request , int clientID , ServerNotificationRegistration serverNotificationRegistration , JSONConverter converter ) { ClientNotificationArea clientArea = getInboxIfAvailable ( clientID , converter ) ; serverNotificationRegistration . filterID = clientArea . getParamId ( serverNotificationRegistration . filter ) ; serverNotificationRegistration . handbackID = clientArea . getParamId ( serverNotificationRegistration . handback ) ; clientArea . addServerNotificationListener ( request , serverNotificationRegistration , converter ) ; String returningURL = APIConstants . JMX_CONNECTOR_API_ROOT_PATH + "/notifications/" + clientID + "/serverRegistrations/" + RESTHelper . URLEncoder ( serverNotificationRegistration . objectName . getCanonicalName ( ) , converter ) + "/listeners/" + RESTHelper . URLEncoder ( serverNotificationRegistration . listener . getCanonicalName ( ) , converter ) + "/ids/" + serverNotificationRegistration . filterID + "_" + serverNotificationRegistration . handbackID ; return returningURL ; } | Add a new server notification registration . This method is only invoked by clients other than our java client . |
24,510 | public void deleteRegisteredListeners ( RESTRequest request , int clientID , ObjectName source_objName , JSONConverter converter ) { ClientNotificationArea clientArea = getInboxIfAvailable ( clientID , null ) ; clientArea . removeAllListeners ( request , source_objName , converter ) ; } | Delete all registered server - side notifications for the given object name . This can only be called from HTTP - direct clients |
24,511 | public void cleanUp ( RESTRequest request , int clientID ) { ClientNotificationArea inbox = inboxes . get ( clientID ) ; if ( inbox != null ) { inbox . cleanUp ( request ) ; inboxes . remove ( clientID ) ; } } | Cleanup specified clientID |
24,512 | public void cleanUp ( RESTRequest request ) { final Iterator < Entry < Integer , ClientNotificationArea > > clients = inboxes . entrySet ( ) . iterator ( ) ; while ( clients . hasNext ( ) ) { Entry < Integer , ClientNotificationArea > client = clients . next ( ) ; ClientNotificationArea inbox = client . getValue ( ) ; if ( inbox . timedOut ( ) ) { inbox . cleanUp ( request ) ; Tr . warning ( tc , "jmx.connector.server.rest.notification.timeout.warning" , client . getKey ( ) ) ; clients . remove ( ) ; } } } | Clean up timed out clients . |
24,513 | private ClientNotificationArea getInboxIfAvailable ( int clientID , JSONConverter converter ) { final ClientNotificationArea inbox = inboxes . get ( clientID ) ; if ( inbox == null ) { throw ErrorHelper . createRESTHandlerJsonException ( new RuntimeException ( "The requested clientID is no longer available because it timed out." ) , converter , APIConstants . STATUS_GONE ) ; } return inbox ; } | This method returns the client inbox or throws an error if the client ID has timed out |
24,514 | private synchronized int getNewClientID ( ) { if ( ( clientIDGenerator + 1 ) >= Integer . MAX_VALUE ) { final int limit = Integer . MIN_VALUE + 100 ; for ( int i = Integer . MIN_VALUE ; i < limit ; i ++ ) { if ( inboxes . get ( i ) == null ) { return i ; } } Tr . warning ( tc , "jmx.connector.server.rest.notification.limit.warning" ) ; throw ErrorHelper . createRESTHandlerJsonException ( new RuntimeException ( "The server has reached its limit of new client notifications." ) , JSONConverter . getConverter ( ) , APIConstants . STATUS_SERVICE_UNAVAILABLE ) ; } return clientIDGenerator ++ ; } | This synchronized method will assign an unique ID to a new notification client |
24,515 | void addAutomaticTimer ( AutomaticTimer timer ) { timer . ivMethod = this ; ivAutomaticTimers . add ( timer ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "added automatic timer: " + timer ) ; } | Adds an automatic timer to this metadata . |
24,516 | private File generateJsonFromIndividualESAs ( Path jsonDirectory , Map < String , String > shortNameMap ) throws IOException , RepositoryException , InstallException { String dir = jsonDirectory . toString ( ) ; List < File > esas = ( List < File > ) data . get ( INDIVIDUAL_ESAS ) ; File singleJson = new File ( dir + "/SingleJson.json" ) ; for ( File esa : esas ) { try { populateFeatureNameFromManifest ( esa , shortNameMap ) ; } catch ( IOException e ) { throw new InstallException ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "ERROR_ESA_NOT_FOUND" , esa . getAbsolutePath ( ) ) ) ; } SingleFileRepositoryConnection mySingleFileRepo = null ; if ( singleJson . exists ( ) ) { mySingleFileRepo = new SingleFileRepositoryConnection ( singleJson ) ; } else { try { mySingleFileRepo = SingleFileRepositoryConnection . createEmptyRepository ( singleJson ) ; } catch ( IOException e ) { throw new InstallException ( Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "ERROR_SINGLE_REPO_CONNECTION_FAILED" , dir , esa . getAbsolutePath ( ) ) ) ; } } Parser < ? extends RepositoryResourceWritable > parser = new EsaParser ( true ) ; RepositoryResourceWritable resource = parser . parseFileToResource ( esa , null , null ) ; resource . updateGeneratedFields ( true ) ; resource . setRepositoryConnection ( mySingleFileRepo ) ; resource . setMavenCoordinates ( esa . getAbsolutePath ( ) ) ; resource . uploadToMassive ( new AddThenDeleteStrategy ( ) ) ; } return singleJson ; } | generate a JSON from provided individual ESA files |
24,517 | public static StatsInstanceImpl createInstance ( String name , String configXmlPath , ObjectName userProvidedMBeanObjectName , boolean bCreateDefaultMBean , StatisticActions actionLsnr ) throws StatsFactoryException { PmiModuleConfig cfg = PerfModules . getConfigFromXMLFile ( configXmlPath , actionLsnr . getCurrentBundle ( ) ) ; if ( cfg == null ) { Tr . warning ( tc , "PMI0102W" , configXmlPath ) ; throw new StatsFactoryException ( nls . getFormattedMessage ( "PMI0102W" , new Object [ ] { configXmlPath } , "Unable to read custom PMI module configuration: {0}" ) + ". " + PerfModules . getParseExceptionMsg ( ) ) ; } StatsInstanceImpl instance = new StatsInstanceImpl ( name , cfg , actionLsnr ) ; instance . _register ( userProvidedMBeanObjectName , bCreateDefaultMBean ) ; return instance ; } | Create singleton instance |
24,518 | public static StatsInstanceImpl createGroupInstance ( String name , StatsGroup igroup , String configXmlPath , ObjectName userProvidedMBeanObjectName , boolean bCreateDefaultMBean , StatisticActions actionLsnr ) throws StatsFactoryException { PmiModuleConfig cfg = PerfModules . getConfigFromXMLFile ( configXmlPath , actionLsnr . getCurrentBundle ( ) ) ; if ( cfg == null ) { Tr . warning ( tc , "PMI0102W" , configXmlPath ) ; throw new StatsFactoryException ( nls . getFormattedMessage ( "PMI0102W" , new Object [ ] { configXmlPath } , "Unable to read custom PMI module configuration: {0}" ) + ". " + PerfModules . getParseExceptionMsg ( ) ) ; } StatsGroupImpl group = ( StatsGroupImpl ) igroup ; StatsFactoryUtil . checkDataIDUniqueness ( group , cfg ) ; String [ ] parentPath = group . getPath ( ) ; String [ ] path = new String [ parentPath . length + 1 ] ; for ( int i = 0 ; i < parentPath . length ; i ++ ) { path [ i ] = parentPath [ i ] ; } path [ parentPath . length ] = name ; StatsInstanceImpl instance = new StatsInstanceImpl ( name , cfg , path , actionLsnr ) ; instance . _register ( userProvidedMBeanObjectName , bCreateDefaultMBean ) ; return instance ; } | Create instance under group |
24,519 | public SPIStatistic getStatistic ( int id ) { for ( int i = 0 ; i < _stats . length ; i ++ ) { if ( _stats [ i ] != null && _stats [ i ] . getId ( ) == id ) { return _stats [ i ] ; } } return null ; } | looping overhead in this method |
24,520 | protected void addUserToRole ( String user , String role ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , CLASS_NAME + "addUserToRole" , new Object [ ] { user , role } ) ; } Set < String > usersForTheRole = roleToUserMap . get ( role ) ; if ( usersForTheRole != null ) { usersForTheRole . add ( user ) ; } else { usersForTheRole = new HashSet < String > ( ) ; usersForTheRole . add ( user ) ; } roleToUserMap . put ( role , usersForTheRole ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , CLASS_NAME + "addUserToRole" ) ; } } | Add a User to the particular role |
24,521 | protected void addGroupToRole ( String group , String role ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , CLASS_NAME + "addGroupToRole" , new Object [ ] { group , role } ) ; } Set < String > groupsForTheRole = roleToGroupMap . get ( role ) ; if ( groupsForTheRole != null ) { groupsForTheRole . add ( group ) ; } else { groupsForTheRole = new HashSet < String > ( ) ; groupsForTheRole . add ( group ) ; } roleToGroupMap . put ( role , groupsForTheRole ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , CLASS_NAME + "addGroupToRole" ) ; } } | Add a Group to the particular role |
24,522 | protected void addAllUsersToRole ( Set < String > users , String role ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , CLASS_NAME + "addAllUsersToRole" , new Object [ ] { users , role } ) ; } Set < String > usersForTheRole = roleToUserMap . get ( role ) ; if ( usersForTheRole != null ) { usersForTheRole . addAll ( users ) ; } else { usersForTheRole = users ; } roleToUserMap . put ( role , usersForTheRole ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , CLASS_NAME + "addAllUsersToRole" ) ; } } | Add all the users to a particular role |
24,523 | protected void addAllGroupsToRole ( Set < String > groups , String role ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , CLASS_NAME + "addAllGroupsToRole" , new Object [ ] { groups , role } ) ; } Set < String > groupsForTheRole = roleToGroupMap . get ( role ) ; if ( groupsForTheRole != null ) { groupsForTheRole . addAll ( groups ) ; } else { groupsForTheRole = groups ; } roleToGroupMap . put ( role , groupsForTheRole ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , CLASS_NAME + "addAllGroupsToRole" ) ; } } | Add all the groups to a particular role |
24,524 | private Map < String , Object > extractOptions ( Map < String , Object > props ) { List < Map < String , Object > > optionsList = Nester . nest ( "options" , props ) ; if ( ! optionsList . isEmpty ( ) ) { Map < String , Object > options = new HashMap < String , Object > ( optionsList . get ( 0 ) . size ( ) ) ; for ( Map . Entry < String , Object > option : optionsList . get ( 0 ) . entrySet ( ) ) { String key = option . getKey ( ) ; if ( key . startsWith ( "." ) || key . startsWith ( "config." ) || key . startsWith ( "service." ) || key . equals ( "id" ) ) { continue ; } options . put ( key , option . getValue ( ) ) ; } return options ; } return new HashMap < String , Object > ( 2 ) ; } | Process the option child element store config attributes in the options map |
24,525 | private void setCL ( final ClassLoader cl ) { PrivilegedAction < Object > action = new PrivilegedAction < Object > ( ) { @ FFDCIgnore ( SecurityException . class ) public Object run ( ) { final Thread t = Thread . currentThread ( ) ; try { t . setContextClassLoader ( cl ) ; } catch ( SecurityException e ) { if ( t instanceof ForkJoinWorkerThread && "InnocuousForkJoinWorkerThreadGroup" . equals ( t . getThreadGroup ( ) . getName ( ) ) ) { throw new SecurityException ( Tr . formatMessage ( tc , "cannot.apply.classloader.context" , t . getName ( ) ) , e ) ; } else { throw e ; } } return null ; } } ; AccessController . doPrivileged ( action ) ; } | Sets the provided classloader on the current thread . |
24,526 | private void readObject ( java . io . ObjectInputStream in ) throws IOException , ClassNotFoundException { GetField fields = in . readFields ( ) ; classLoaderIdentifier = ( String ) fields . get ( CLASS_LOADER_IDENTIFIER , null ) ; } | Reads and deserializes the input object . |
24,527 | protected void dumpJFapClientStatus ( IncidentStream is ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dumpJFapClientStatus" ) ; ClientConnectionManager ccm = ClientConnectionManager . getRef ( ) ; List obc = ccm . getActiveOutboundConversationsForFfdc ( ) ; is . writeLine ( "\n------ Client Conversation Dump ------ " , ">" ) ; if ( obc != null ) { final Map < Object , LinkedList < Conversation > > connectionToConversationMap = convertToMap ( is , obc ) ; for ( Iterator < Entry < Object , LinkedList < Conversation > > > i = connectionToConversationMap . entrySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { final Entry < Object , LinkedList < Conversation > > entry = i . next ( ) ; is . writeLine ( "\nOutbound connection:" , entry . getKey ( ) ) ; LinkedList conversationList = entry . getValue ( ) ; while ( ! conversationList . isEmpty ( ) ) { Conversation c = ( Conversation ) conversationList . removeFirst ( ) ; is . writeLine ( "\nOutbound Conversation[" + c . getId ( ) + "]: " , c . getFullSummary ( ) ) ; try { dumpClientConversation ( is , c ) ; } catch ( Throwable t ) { is . writeLine ( "\nUnable to dump conversation" , t ) ; } } } } else { is . writeLine ( "\nUnable to fetch list of conversations" , "" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "dumpJFapClientStatus" ) ; } | This method dumps the status of any client conversations that are currently active . It does this by asking the JFap outbound connection tracker for its list of active conversations and then has a look at the conversation states . All this information is captured in the FFDC incident stream |
24,528 | protected void dumpJFapServerStatus ( IncidentStream is ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "dumpJFapServerStatus" , is ) ; is . writeLine ( "No Server Conversation Dump" , "" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "dumpJFapServerStatus" ) ; } | This method does nothing for the client diagnostic module . |
24,529 | private void dumpClientConversation ( IncidentStream is , Conversation conv ) throws SIException { ClientConversationState convState = ( ClientConversationState ) conv . getAttachment ( ) ; SICoreConnection siConn = convState . getSICoreConnection ( ) ; if ( siConn == null ) { is . writeLine ( " ** No SICoreConnection in ConversationState **" , "(Conversation is initializing?)" ) ; } else { is . writeLine ( " Connected using: " , convState . getCommsConnection ( ) ) ; is . writeLine ( " Connected to ME: " , siConn . getMeName ( ) + " [" + siConn . getMeUuid ( ) + "]" ) ; is . writeLine ( " Resolved UserId: " , siConn . getResolvedUserid ( ) ) ; is . writeLine ( " ME is version " , siConn . getApiLevelDescription ( ) ) ; ProxyQueueConversationGroupImpl pqgroup = ( ProxyQueueConversationGroupImpl ) convState . getProxyQueueConversationGroup ( ) ; if ( pqgroup == null ) { is . writeLine ( " Number of proxy queues found" , "0" ) ; } else { Map map = pqgroup . getProxyQueues ( ) ; Map idToProxyQueueMap = ( Map ) ( ( HashMap ) map ) . clone ( ) ; is . writeLine ( " Number of proxy queues found" , idToProxyQueueMap . size ( ) ) ; for ( Iterator i2 = idToProxyQueueMap . values ( ) . iterator ( ) ; i2 . hasNext ( ) ; ) { ProxyQueue pq = ( ProxyQueue ) i2 . next ( ) ; is . writeLine ( " " , pq ) ; } } is . introspectAndWriteLine ( "Introspection of the conversation state:" , convState ) ; } } | This method dumps the particulars of a particular client conversation . |
24,530 | protected Map < Object , LinkedList < Conversation > > convertToMap ( final IncidentStream is , final List obc ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "convertToMap" , new Object [ ] { is , obc } ) ; final Map < Object , LinkedList < Conversation > > connectionToConversationMap = new HashMap < Object , LinkedList < Conversation > > ( ) ; for ( Iterator i = obc . iterator ( ) ; i . hasNext ( ) ; ) { try { final Conversation c = ( Conversation ) i . next ( ) ; final Object connectionObject = c . getConnectionReference ( ) ; final LinkedList < Conversation > conversationList ; if ( ! connectionToConversationMap . containsKey ( connectionObject ) ) { conversationList = new LinkedList < Conversation > ( ) ; connectionToConversationMap . put ( connectionObject , conversationList ) ; } else { conversationList = connectionToConversationMap . get ( connectionObject ) ; } conversationList . add ( c ) ; } catch ( Throwable t ) { is . writeLine ( "\nUnable to dump conversation" , t ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "convertToMap" , connectionToConversationMap ) ; return connectionToConversationMap ; } | Generates a set of mappings between a Connection and the Conversations which are making use of it . |
24,531 | protected void activate ( Map < String , Object > properties ) throws Exception { this . host = ( String ) properties . get ( "host" ) ; Integer iiopPort = ( Integer ) properties . get ( "iiopPort" ) ; this . iiopPort = iiopPort == null ? - 1 : iiopPort ; iiopsOptions = Nester . nest ( "iiopsOptions" , properties ) ; } | Start the ORB associated with this bean instance . |
24,532 | public void initializeInstanceData ( String methodSign , String methodNameOnly , BeanMetaData beanMetaData , MethodInterface methodInterface , TransactionAttribute tranAttr , boolean asyncMethod ) { this . methodSignature = methodSign ; this . methodName = methodNameOnly ; this . bmd = beanMetaData ; this . ivInterface = methodInterface ; this . txAttr = tranAttr ; this . ivAsynchMethod = asyncMethod ; if ( bmd != null ) { isStatefulSessionBean = bmd . type == InternalConstants . TYPE_STATEFUL_SESSION ; isStatelessSessionBean = bmd . type == InternalConstants . TYPE_STATELESS_SESSION ; isSingletonSessionBean = bmd . type == InternalConstants . TYPE_SINGLETON_SESSION ; } this . isHome = ( methodInterface == MethodInterface . HOME || methodInterface == MethodInterface . LOCAL_HOME ) ; this . isLocal = ( methodInterface == MethodInterface . LOCAL || methodInterface == MethodInterface . LOCAL_HOME ) ; this . isHomeCreate = ( this . isHome && "create" . equals ( methodName ) ) ; this . setClassLoader = ( methodInterface == MethodInterface . LOCAL || methodInterface == MethodInterface . LOCAL_HOME || methodInterface == MethodInterface . SERVICE_ENDPOINT || methodInterface == MethodInterface . MESSAGE_LISTENER || methodInterface == MethodInterface . TIMED_OBJECT || ivAsynchMethod ) ; this . isLightweight = isLocal && beanMetaData != null && beanMetaData . isLightweight ; this . isLightweightTxCapable = isLightweight && ( ( tranAttr == TransactionAttribute . TX_REQUIRED || tranAttr == TransactionAttribute . TX_SUPPORTS || tranAttr == TransactionAttribute . TX_MANDATORY ) && ( asAttr == ActivitySessionAttribute . AS_UNKNOWN || asAttr == ActivitySessionAttribute . AS_SUPPORTS ) ) ; } | d140003 . 35 |
24,533 | public List < String > getRolesAllowed ( ) { return ivRolesAllowed == null ? Collections . < String > emptyList ( ) : Arrays . asList ( ivRolesAllowed ) ; } | Return a list containing all security roles that are allowed to execute this method . |
24,534 | public final void forget ( ) throws XAException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "forget" , new Object [ ] { _resource , _xid } ) ; if ( tcSummary . isDebugEnabled ( ) ) Tr . debug ( tcSummary , "xa_forget" , this ) ; int rc = - 1 ; try { if ( ! _completed && _resource != null ) { if ( _state == FAILED ) _resource = reconnectRM ( ) ; _resource . forget ( _xid ) ; rc = XAResource . XA_OK ; destroy ( ) ; } } catch ( XAException xae ) { rc = xae . errorCode ; throw xae ; } finally { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "forget" ) ; if ( tcSummary . isDebugEnabled ( ) ) Tr . debug ( tcSummary , "xa_rollback result: " + XAReturnCodeHelper . convertXACode ( rc ) ) ; } } | The resource manager can forget all knowledge of the transaction . |
24,535 | public void log ( RecoverableUnitSection rus ) throws SystemException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "log" , new Object [ ] { this , rus } ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "about to log stoken " + Util . toHexString ( ( ( XidImpl ) _xid ) . getStoken ( ) ) ) ; Tr . debug ( tc , "about to log recoveryId " + getRecoveryId ( ) ) ; Tr . debug ( tc , "about to log seqNo " + ( ( XidImpl ) _xid ) . getSequenceNumber ( ) ) ; Tr . debug ( tc , "ID from pld " + _recoveryData . _recoveryId ) ; } final byte [ ] stoken = ( ( XidImpl ) _xid ) . getStoken ( ) ; final int recoveryId = ( int ) getRecoveryId ( ) ; final int seqNo = ( ( XidImpl ) _xid ) . getSequenceNumber ( ) ; final byte [ ] data = new byte [ stoken . length + 6 ] ; System . arraycopy ( stoken , 0 , data , 0 , stoken . length ) ; Util . setBytesFromInt ( data , stoken . length , 4 , recoveryId ) ; Util . setBytesFromInt ( data , stoken . length + 4 , 2 , seqNo ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "logging stoken " + Util . toHexString ( stoken ) ) ; Tr . debug ( tc , "logging recoveryId " + recoveryId ) ; Tr . debug ( tc , "logging seqNo " + seqNo ) ; Tr . debug ( tc , "Actual data logged" , Util . toHexString ( data ) ) ; } try { rus . addData ( data ) ; } catch ( Exception exc ) { FFDCFilter . processException ( exc , "com.ibm.ws.Transaction.JTA.JTAXAResourceImpl.log" , "326" , this ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "Exception raised adding data to the transaction log" , exc ) ; throw new SystemException ( exc . toString ( ) ) ; } finally { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "log" ) ; } } | Write information about the resource to the transaction log |
24,536 | public final void destroy ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "destroy" , new Object [ ] { _resource , _xid } ) ; if ( ! _completed ) { if ( _recoveredRM != null ) { _recoveredRM . closeConnection ( ) ; _recoveredRM = null ; if ( _recovery ) { if ( _recoveryData != null ) _recoveryData . decrementCount ( ) ; } } _completed = true ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "destroy" ) ; } | Destroy the JTAXAResourceImpl object from XAResourceManager . |
24,537 | private List < ELResolver > _getFacesConfigElResolvers ( ) { if ( _facesConfigResolvers == null ) { ExternalContext externalContext = FacesContext . getCurrentInstance ( ) . getExternalContext ( ) ; RuntimeConfig runtimeConfig = RuntimeConfig . getCurrentInstance ( externalContext ) ; _facesConfigResolvers = runtimeConfig . getFacesConfigElResolvers ( ) ; } return _facesConfigResolvers ; } | Returns a List of all ELResolvers from the faces - config . |
24,538 | public static DistributedObjectCache getMap ( String name , Properties properties ) { final String methodName = "getMap()" ; if ( tc . isEntryEnabled ( ) ) { Tr . entry ( tc , methodName + " name: (" + name + ") properties:" + properties ) ; } if ( name == null || name . trim ( ) . length ( ) == 0 ) { throw new IllegalStateException ( "Map name can not be null or empty" ) ; } if ( ServerCache . objectCacheEnabled == false ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " WebSphere Dynamic Cache instance named " + name + " cannot be used because of Dynamic Object cache service has not be started." ) ; } return null ; } DistributedObjectCache distributedObjectCache = null ; synchronized ( distributedMapsSynchronizeObject ) { distributedObjectCache = distributedMaps . get ( name ) ; if ( distributedObjectCache == null ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " Existing DistributedObjectCache not found for " + name ) ; } distributedObjectCache = createDistributedObjectCache ( name , properties ) ; distributedMaps . put ( name , distributedObjectCache ) ; } else { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " Existing DistributedObjectCache found for " + name + " " + distributedObjectCache ) ; } } } if ( tc . isEntryEnabled ( ) ) { Tr . exit ( tc , methodName + " map:" + distributedObjectCache ) ; } return distributedObjectCache ; } | Returns the DistributedMap or DistributedNioMap instance specified by the given id using the the parameters specified in properties . If the given instance has not yet been created then a new instance is created using the parameters specified in the properties object . Use the various KEY_xxx and VALUE_xxx constants to populate the passed properties object . |
24,539 | private static List < URL > getBundleEmbeddedLibs ( final URL jarFileUrl ) throws IOException , PrivilegedActionException { return AccessController . doPrivileged ( new PrivilegedExceptionAction < List < URL > > ( ) { public List < URL > run ( ) throws Exception { JarFile jarFile = new JarFile ( URLDecoder . decode ( jarFileUrl . getFile ( ) , "utf-8" ) ) ; List < URL > libs = new LinkedList < URL > ( ) ; Attributes manifest = jarFile . getManifest ( ) . getMainAttributes ( ) ; String rawBundleClasspath = manifest . getValue ( "Bundle-ClassPath" ) ; if ( rawBundleClasspath != null ) { Set < String > allValidBundleClassPaths = new HashSet < String > ( ) ; String [ ] bundleClassPaths = rawBundleClasspath . split ( "," ) ; for ( String bundleClassPath : bundleClassPaths ) { bundleClassPath = bundleClassPath . trim ( ) ; if ( ! bundleClassPath . equals ( "." ) && bundleClassPath . endsWith ( ".jar" ) ) { allValidBundleClassPaths . add ( bundleClassPath ) ; } } Enumeration < JarEntry > entries = jarFile . entries ( ) ; File tempDir = createTempDir ( "was-cmdline" ) ; tempDir . deleteOnExit ( ) ; int MAX_READ_SIZE = 512 ; int offset = 0 , read = 0 ; byte [ ] buff = new byte [ MAX_READ_SIZE ] ; while ( entries . hasMoreElements ( ) ) { JarEntry jarEntry = entries . nextElement ( ) ; String entryName = jarEntry . getName ( ) ; if ( allValidBundleClassPaths . contains ( entryName ) ) { String fileName = entryName ; int index ; while ( ( index = fileName . indexOf ( "/" ) ) != - 1 ) { fileName = fileName . substring ( index + 1 ) ; } InputStream stream = jarFile . getInputStream ( jarEntry ) ; File file = new File ( tempDir , fileName ) ; file . deleteOnExit ( ) ; FileOutputStream fileStream = new FileOutputStream ( file ) ; while ( ( read = stream . read ( buff , offset , MAX_READ_SIZE ) ) > 0 ) { fileStream . write ( buff , 0 , read ) ; } fileStream . flush ( ) ; fileStream . close ( ) ; stream . close ( ) ; libs . add ( file . toURI ( ) . toURL ( ) ) ; } } } jarFile . close ( ) ; return libs ; } } ) ; } | Support for embedded libs in a bundle . |
24,540 | public String lookupVariable ( String variableName ) { String varReference = XMLConfigConstants . VAR_OPEN + variableName + XMLConfigConstants . VAR_CLOSE ; String resolvedVar = registry . resolveRawString ( varReference ) ; return varReference . equalsIgnoreCase ( resolvedVar ) ? null : resolvedVar ; } | Resolve the given variable . |
24,541 | public String lookupVariableDefaultValue ( String variableName ) { ConfigVariable cv = configVariables . get ( variableName ) ; return cv == null ? null : cv . getDefaultValue ( ) ; } | Returns the defaultValue from the variable definition or null if it doesn t exist . |
24,542 | public JwtClaims getJwtClaims ( String jwt ) throws JoseException { String methodName = "getJwtClaims" ; if ( tc . isDebugEnabled ( ) ) { Tr . entry ( tc , methodName , jwt ) ; } JwtClaims jwtclaims = new JwtClaims ( ) ; String payload = getJwtPayload ( jwt ) ; if ( payload != null ) { jwtclaims = getClaimsFromJwtPayload ( jwt , payload ) ; } if ( tc . isDebugEnabled ( ) ) { Tr . exit ( tc , methodName , jwtclaims ) ; } return jwtclaims ; } | Parses the provided JWT and returns the claims found within its payload . |
24,543 | private void convertJoseTypes ( JwtClaims claimsSet ) { if ( claimsSet . hasClaim ( "address" ) ) { replaceMapWithJsonObject ( "address" , claimsSet ) ; } if ( claimsSet . hasClaim ( "jwk" ) ) { replaceMapWithJsonObject ( "jwk" , claimsSet ) ; } if ( claimsSet . hasClaim ( "sub_jwk" ) ) { replaceMapWithJsonObject ( "sub_jwk" , claimsSet ) ; } if ( claimsSet . hasClaim ( "aud" ) ) { convertToList ( "aud" , claimsSet ) ; } if ( claimsSet . hasClaim ( "groups" ) ) { convertToList ( "groups" , claimsSet ) ; } } | Convert the types jose4j uses for address sub_jwk and jwk |
24,544 | @ FFDCIgnore ( { MalformedClaimException . class } ) private void convertToList ( String claimName , JwtClaims claimsSet ) { List < String > list = null ; try { list = claimsSet . getStringListClaimValue ( claimName ) ; } catch ( MalformedClaimException e ) { try { String value = claimsSet . getStringClaimValue ( claimName ) ; if ( value != null ) { list = new ArrayList < String > ( ) ; list . add ( value ) ; claimsSet . setClaim ( claimName , list ) ; } } catch ( MalformedClaimException e1 ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "The value for the claim [" + claimName + "] could not be convered to a string list: " + e1 . getLocalizedMessage ( ) ) ; } } } } | Converts the value for the specified claim into a String list . |
24,545 | private void configureResolverForJSP ( JspApplicationContext appCtx , RuntimeConfig runtimeConfig ) { FacesCompositeELResolver facesCompositeELResolver = new FacesCompositeELResolver ( Scope . JSP ) ; appCtx . addELResolver ( facesCompositeELResolver ) ; PhaseListener resolverForJSPInitializer = new ResolverForJSPInitializer ( createResolverBuilderForJSP ( runtimeConfig ) , facesCompositeELResolver ) ; LifecycleFactory factory = ( LifecycleFactory ) FactoryFinder . getFactory ( FactoryFinder . LIFECYCLE_FACTORY ) ; for ( Iterator < String > iter = factory . getLifecycleIds ( ) ; iter . hasNext ( ) ; ) { factory . getLifecycle ( iter . next ( ) ) . addPhaseListener ( resolverForJSPInitializer ) ; } } | Register a phase listener to every lifecycle . This listener will lazy fill the el resolver for jsp as soon as the first lifecycle is executed . This is necessarry to allow a faces application further setup after MyFaces has been initialized . When the first request is processed no further configuation of the el resolvers is allowed . |
24,546 | private Cookie logInAndObtainCookie ( String testName , WebClient webClient , String protectedUrl , String username , String password , String cookieName , Expectations expectations ) throws Exception { Page response = invokeProtectedUrlAndValidateResponse ( testName , webClient , protectedUrl , expectations ) ; doFormLoginAndValidateResponse ( response , username , password , expectations ) ; Cookie cookie = webClient . getCookieManager ( ) . getCookie ( cookieName ) ; assertNotNull ( "Cookie [" + cookieName + "] was null but should not have been." , cookie ) ; return cookie ; } | Accesses the protected resource and logs in successfully ensuring that the expected cookie is included in the result . |
24,547 | public long toLong ( ) { long result = 0 ; byte [ ] uuidBytes = super . toByteArray ( ) ; for ( int i = 0 ; i < 8 ; i ++ ) { result = result << 8 ; result += ( int ) uuidBytes [ i ] ; } return result ; } | Return a long representing the SIBUuid8 . |
24,548 | public static void transform ( InputStream XMLStream , OutputStream JSONStream , boolean verbose ) throws SAXException , IOException { if ( logger . isLoggable ( Level . FINER ) ) { logger . entering ( className , "transform(InputStream, OutputStream)" ) ; } if ( XMLStream == null ) { throw new NullPointerException ( "XMLStream cannot be null" ) ; } else if ( JSONStream == null ) { throw new NullPointerException ( "JSONStream cannot be null" ) ; } else { if ( logger . isLoggable ( Level . FINEST ) ) { logger . logp ( Level . FINEST , className , "transform" , "Fetching a SAX parser for use with JSONSAXHandler" ) ; } try { SAXParserFactory factory = SAXParserFactory . newInstance ( ) ; factory . setNamespaceAware ( true ) ; SAXParser sParser = factory . newSAXParser ( ) ; XMLReader parser = sParser . getXMLReader ( ) ; JSONSAXHandler jsonHandler = new JSONSAXHandler ( JSONStream , verbose ) ; parser . setContentHandler ( jsonHandler ) ; parser . setErrorHandler ( jsonHandler ) ; InputSource source = new InputSource ( new BufferedInputStream ( XMLStream ) ) ; if ( logger . isLoggable ( Level . FINEST ) ) { logger . logp ( Level . FINEST , className , "transform" , "Parsing the XML content to JSON" ) ; } source . setEncoding ( "UTF-8" ) ; parser . parse ( source ) ; jsonHandler . flushBuffer ( ) ; } catch ( javax . xml . parsers . ParserConfigurationException pce ) { throw new SAXException ( "Could not get a parser: " + pce . toString ( ) ) ; } } if ( logger . isLoggable ( Level . FINER ) ) { logger . exiting ( className , "transform(InputStream, OutputStream)" ) ; } } | Method to do the transform from an XML input stream to a JSON stream . Neither input nor output streams are closed . Closure is left up to the caller . |
24,549 | public static String transform ( File xmlFile , boolean verbose ) throws SAXException , IOException { if ( logger . isLoggable ( Level . FINER ) ) { logger . exiting ( className , "transform(InputStream, boolean)" ) ; } FileInputStream fis = new FileInputStream ( xmlFile ) ; String result = null ; result = transform ( fis , verbose ) ; fis . close ( ) ; if ( logger . isLoggable ( Level . FINER ) ) { logger . exiting ( className , "transform(InputStream, boolean)" ) ; } return result ; } | Method to take an XML file and return a String of the JSON format . |
24,550 | @ Reference ( cardinality = ReferenceCardinality . MULTIPLE , policyOption = ReferencePolicyOption . GREEDY ) protected synchronized void setCustomUserRegistry ( com . ibm . websphere . security . UserRegistry externalUserRegistry , Map < String , Object > props ) { String id = getId ( props ) ; customUserRegistries . put ( id , externalUserRegistry ) ; } | Method will be called for each com . ibm . websphere . security . UserRegistry that is registered in the OSGi service registry . We maintain an internal set of these for easy access . |
24,551 | protected synchronized void unsetCustomUserRegistry ( Map < String , Object > props ) { String id = getId ( props ) ; customUserRegistries . remove ( id ) ; ServiceRegistration < UserRegistry > registration = registrynRegistrationsToUnregister . remove ( id ) ; if ( registration != null ) { registration . unregister ( ) ; } } | Method will be called for each com . ibm . websphere . security . UserRegistry that is unregistered in the OSGi service registry . We must remove this instance from our internal set of listeners . |
24,552 | @ ProbeSite ( clazz = "com.ibm.ejs.j2c.FreePool" , method = "queueRequest" ) public void waitTimeEntry ( ) { if ( tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "waitTimeEntry" ) ; } tlocalforwtTime . set ( System . currentTimeMillis ( ) ) ; if ( tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "waitTimeEntry" ) ; } } | Code which sets the entry time for queueRequest for wait time . We set it in ThreadLocal variable |
24,553 | private AuthenticationResult handleFormLogin ( HttpServletRequest req , HttpServletResponse res , WebRequest webRequest ) { AuthenticationResult authResult = null ; authResult = ssoAuthenticator . authenticate ( webRequest ) ; if ( authResult != null ) { authResult . setAuditCredType ( AuditEvent . CRED_TYPE_FORM ) ; } if ( authResult != null && authResult . getStatus ( ) != AuthResult . FAILURE ) { postParameterHelper . restore ( req , res ) ; return authResult ; } try { authResult = providerAuthenticatorProxy . authenticate ( req , res , null ) ; } catch ( Exception e ) { return new AuthenticationResult ( AuthResult . FAILURE , e . getLocalizedMessage ( ) ) ; } if ( authResult . getStatus ( ) == AuthResult . CONTINUE ) { authResult = null ; if ( webRequest . isFormLoginRedirectEnabled ( ) ) { authResult = handleRedirect ( req , res , webRequest ) ; if ( authResult != null ) { authResult . setAuditCredType ( AuditEvent . CRED_TYPE_FORM ) ; authResult . setAuditOutcome ( AuditEvent . OUTCOME_REDIRECT ) ; } } } return authResult ; } | This method handle formlogin ; If the SSO cookie exist then it will use the cookie to authenticate . If the cookie does not exist then it will re - redirect to the login page . |
24,554 | private AuthenticationResult handleRedirect ( HttpServletRequest req , HttpServletResponse res , WebRequest webRequest ) { AuthenticationResult authResult ; String loginURL = getFormLoginURL ( req , webRequest , webAppSecurityConfig ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "form login URL: " + loginURL ) ; } authResult = new AuthenticationResult ( AuthResult . REDIRECT , loginURL ) ; if ( allowToAddCookieToResponse ( webAppSecurityConfig , req ) ) { postParameterHelper . save ( req , res , authResult ) ; ReferrerURLCookieHandler referrerURLHandler = webAppSecurityConfig . createReferrerURLCookieHandler ( ) ; Cookie c = referrerURLHandler . createReferrerURLCookie ( ReferrerURLCookieHandler . REFERRER_URL_COOKIENAME , getReqURL ( req ) , req ) ; authResult . setCookie ( c ) ; } return authResult ; } | This method save post parameters in the cookie or session and redirect to a login page . |
24,555 | private void filterDirectory ( List < String > dirContent , DirPattern dirPattern , String parentPath ) throws IOException { File workingDirectory = new File ( source , parentPath ) ; if ( workingDirectory . exists ( ) ) { File [ ] dirListing = workingDirectory . listFiles ( ) ; if ( dirListing != null ) { for ( int i = 0 ; i < dirListing . length ; i ++ ) { File file = dirListing [ i ] ; boolean includeFileInArchive ; if ( dirPattern . getStrategy ( ) == PatternStrategy . IncludePreference ) { includeFileInArchive = DirPattern . includePreference ( file , dirPattern . getExcludePatterns ( ) , dirPattern . getIncludePatterns ( ) , dirPattern . includeByDefault ) ; } else { includeFileInArchive = DirPattern . excludePreference ( file , dirPattern . getExcludePatterns ( ) , dirPattern . getIncludePatterns ( ) , dirPattern . includeByDefault ) ; } if ( includeFileInArchive ) { dirContent . add ( parentPath + file . getName ( ) ) ; } if ( file . isDirectory ( ) ) { filterDirectory ( dirContent , dirPattern , parentPath + file . getName ( ) + "/" ) ; } } } } } | filter the directory according to the dir pattern |
24,556 | public final void start ( long loaderInterval , JsMessagingEngine jsme ) throws MessageStoreRuntimeException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "start" , Long . valueOf ( loaderInterval ) ) ; messagingEngine = jsme ; if ( loaderInterval >= 0 ) { interval = loaderInterval * 1000 ; } else { String value = messageStore . getProperty ( MessageStoreConstants . PROP_CACHELOADER_INTERVAL , MessageStoreConstants . PROP_CACHELOADER_INTERVAL_DEFAULT ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( this , tc , "start" , "Interval from system prop=<" + value + ">" ) ; } try { this . interval = Long . parseLong ( value . trim ( ) ) * 1000 ; } catch ( NumberFormatException e ) { lastException = e ; lastExceptionTime = timeNow ( ) ; SibTr . debug ( this , tc , "start" , "Unable to parse cacheLoaderInterval property: " + e ) ; this . interval = 60000 ; } } String value = messageStore . getProperty ( MessageStoreConstants . PROP_MAX_STREAMS_PER_CYCLE , MessageStoreConstants . PROP_MAX_STREAMS_PER_CYCLE_DEFAULT ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( this , tc , "start" , "maxStreamsPerCycle from system prop=<" + value + ">" ) ; } try { maxStreamsPerCycle = Integer . parseInt ( value . trim ( ) ) ; } catch ( NumberFormatException e ) { lastException = e ; lastExceptionTime = timeNow ( ) ; SibTr . debug ( this , tc , "start" , "Unable to parse maxStreamsPerCycle property: " + e ) ; maxStreamsPerCycle = 10 ; } PersistentMessageStore pm = messageStore . getPersistentMessageStore ( ) ; try { results = pm . identifyStreamsWithExpirableItems ( ) ; totalStreams = results . size ( ) ; iter = results . iterator ( ) ; if ( interval < 1 ) { enabled = false ; } else { if ( loaderAlarm == null ) { enabled = true ; shutdown = false ; loaderStartTime = timeNow ( ) ; loaderAlarm = scheduleAlarm ( interval ) ; } } } catch ( PersistenceException pe ) { com . ibm . ws . ffdc . FFDCFilter . processException ( pe , "com.ibm.ws.sib.msgstore.expiry.CacheLoader.run" , "191" , this ) ; lastException = pe ; lastExceptionTime = timeNow ( ) ; enabled = false ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( this , tc , "run" , "CacheLoader stopping - interrupted: " + pe ) ; } throw new MessageStoreRuntimeException ( "CACHE_LOADER_TERMINATED_SIMS2003" , new Object [ ] { pe } , pe ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "start" , "enabled=" + enabled + " interval=" + interval ) ; } | Start the CacheLoader daemon . |
24,557 | public final void stop ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "stop" ) ; synchronized ( alarmLock ) { if ( enabled ) { loaderStopTime = timeNow ( ) ; enabled = false ; shutdown = true ; } if ( loaderAlarm != null ) { loaderAlarm . cancel ( ) ; loaderAlarm = null ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "stop" ) ; } | Stop the CacheLoader daemon . |
24,558 | private int saveStartTime ( long time ) { int indexUsed = diagIndex ; cycleTime [ diagIndex ++ ] = time ; if ( diagIndex >= MAX_DIAG_LOG ) { diagIndex = 0 ; } return indexUsed ; } | Keep last n cycle start times for diagnostic dump . |
24,559 | private Alarm scheduleAlarm ( long timeOut ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "scheduleAlarm timeOut=" + timeOut ) ; Alarm alarm = AlarmManager . createNonDeferrable ( timeOut , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "scheduleAlarm" ) ; return alarm ; } | Schedule the next alarm . |
24,560 | public SICoreConnection getSICoreConnection ( ) throws SIConnectionLostException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getSICoreConnection" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Building connection proxy object using ID: " , "" + getConnectionObjectID ( ) ) ; ClientConversationState convState = ( ClientConversationState ) getConversation ( ) . getAttachment ( ) ; SICoreConnection siConn = convState . getSICoreConnection ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getSICoreConnection" , siConn ) ; return siConn ; } | Returns the SICoreConnection associated with this connection . The actual proxy object will have been created and saved in the conversation state when the server returned us the information about the connection . So here we just retrieve it and return it . |
24,561 | public void sendMFPSchema ( byte [ ] schemaData ) throws SIConnectionLostException , SIConnectionDroppedException , SIConnectionUnavailableException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "sendMFPSchema" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . bytes ( this , tc , schemaData ) ; CommsByteBuffer request = getCommsByteBuffer ( ) ; request . wrap ( schemaData ) ; jfapSend ( request , JFapChannelConstants . SEG_SEND_SCHEMA_NOREPLY , JFapChannelConstants . PRIORITY_HIGHEST , true , ThrottlingPolicy . BLOCK_THREAD ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "sendMFPSchema" ) ; } | Attempts to send an MFP message schema to the peer at the highest possible priority . At Message encode time MFP can discover that the destination entity cannot decode the message about to be sent . This method is then called to send a top priority transmission containing the message schema ahead of the message relying on it to ensure it can be decoded correctly . |
24,562 | public void close ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" ) ; try { Conversation conv = getConversation ( ) ; if ( conv != null ) conv . close ( ) ; } catch ( SIConnectionLostException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".close" , CommsConstants . CLIENTSIDECONNECTION_CONNECT_02 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Unable to close connection" , e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ; } | Performs a controlled close of this connection . It is not valid to invoke this method whilst within connect processing . If possible a close request is proporgated to the remote peer associated with this ClientConnection . |
24,563 | public void connectionClosed ( Object linkLevelAttachement ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "connectionClosed" , linkLevelAttachement ) ; try { CompHandshake ch = ( CompHandshake ) CompHandshakeFactory . getInstance ( ) ; ch . compClose ( this ) ; } catch ( Exception e1 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "MFP unable to create CompHandshake Singleton" , e1 ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "connectionClosed" ) ; } | Called when the JFap channel has closed the underlying connection . At this point we can inform MFP so that they can delete the schema information that refered to this connection . |
24,564 | public byte [ ] requestMFPSchemata ( byte [ ] schemaData ) throws SIConnectionLostException , SIConnectionDroppedException , SIConnectionUnavailableException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "requestMFPSchemata" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . bytes ( this , tc , schemaData ) ; byte [ ] returnSchemaData = null ; CommsByteBuffer request = getCommsByteBuffer ( ) ; request . wrap ( schemaData ) ; CommsByteBuffer reply = jfapExchange ( request , JFapChannelConstants . SEG_REQUEST_SCHEMA , JFapChannelConstants . PRIORITY_HIGHEST , true ) ; try { short err = reply . getCommandCompletionCode ( JFapChannelConstants . SEG_REQUEST_SCHEMA_R ) ; if ( err != CommsConstants . SI_NO_EXCEPTION ) { checkFor_SIConnectionUnavailableException ( reply , err ) ; checkFor_SIErrorException ( reply , err ) ; defaultChecker ( reply , err ) ; } returnSchemaData = reply . getRemaining ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . bytes ( this , tc , returnSchemaData ) ; } finally { if ( reply != null ) reply . release ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "requestMFPSchemata" , returnSchemaData ) ; return returnSchemaData ; } | Used to synchronously request an MFP schema from the server . This code will block until the server replies with the requested data . |
24,565 | public void setSchemaSet ( ConnectionSchemaSet schemaSet ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setSchemaSet" , schemaSet ) ; getConversation ( ) . setSchemaSet ( schemaSet ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setSchemaSet" ) ; } | setSchemaSet Sets the schemaSet in the underlying Connection . |
24,566 | public ConnectionSchemaSet getSchemaSet ( ) throws SIConnectionDroppedException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getSchemaSet" ) ; ConnectionSchemaSet result = getConversation ( ) . getSchemaSet ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getSchemaSet" , result ) ; return result ; } | getSchemaSet Returns the MFP SchemaSet which pertains to the underlying Connection . |
24,567 | private static String toDigest ( String input ) { md . reset ( ) ; try { md . update ( input . getBytes ( "UTF-8" ) ) ; } catch ( UnsupportedEncodingException e ) { } String result = com . ibm . ws . common . internal . encoder . Base64Coder . base64EncodeToString ( md . digest ( ) ) ; return result ; } | store as digests to save space |
24,568 | protected ObjectManagerByteArrayOutputStream [ ] getBuffers ( ) throws ObjectManagerException { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "getBuffers" ) ; ObjectManagerByteArrayOutputStream [ ] buffers = new ObjectManagerByteArrayOutputStream [ 1 ] ; buffers [ 0 ] = new ObjectManagerByteArrayOutputStream ( overhead ) ; buffers [ 0 ] . writeInt ( LogRecord . TYPE_PADDING ) ; buffers [ 0 ] . writeInt ( totalSize - overhead ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "getBuffers" , new Object [ ] { buffers } ) ; return buffers ; } | Gives back the serialized LogRecord as an arrays of bytes . |
24,569 | private Exception mapCSIException ( EJSDeployedSupport s , CSIException e ) throws CSIException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "mapCSIException: " + e ) ; } Exception mappedException = null ; String message = " " ; RemoteException rex ; if ( e instanceof CSITransactionRolledbackException ) { if ( e . detail instanceof HeuristicMixedException ) { rex = new RemoteException ( "" , e . detail ) ; } else if ( IncludeNestedExceptionsExtended && ( s . began || AllowSpecViolationOnRollback ) && ( e . detail instanceof HeuristicRollbackException ) ) { rex = new RemoteException ( "" , e . detail ) ; } else { rex = new TransactionRolledbackException ( message ) ; } } else if ( e instanceof CSIAccessException ) { rex = new AccessException ( message ) ; } else if ( e instanceof CSIInvalidTransactionException ) { rex = new InvalidTransactionException ( message ) ; } else if ( e instanceof CSITransactionRequiredException ) { rex = new TransactionRequiredException ( message ) ; } else if ( e instanceof CSINoSuchObjectException ) { rex = new java . rmi . NoSuchObjectException ( message ) ; } else { e . detail = null ; rex = new RemoteException ( e . getMessage ( ) ) ; } if ( IncludeNestedExceptions ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Nested exceptions will be included on rollback when possible. " + rex + ": " + s . began ) ; if ( ( rex instanceof TransactionRolledbackException ) && ( s . began || AllowSpecViolationOnRollback ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Transaction was begun in context of this bean method, or " + "the user allows the spec to be violated " + "(ContainerProperties.AllowSpecViolationOnRollback=" + AllowSpecViolationOnRollback + ")." ) ; rex = new RemoteException ( "" , rex ) ; } } rex . detail = s . rootEx ; rex . setStackTrace ( s . rootEx . getStackTrace ( ) ) ; if ( s . ivWrapper . ivInterface . ivORB ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "mapCSIException calling OrbUtils.mapException: " + rex ) ; } int minorCode = e . getMinorCode ( ) ; if ( minorCode == CSIException . NO_MINOR_CODE ) { mappedException = getOrbUtils ( ) . mapException ( rex ) ; } else { mappedException = getOrbUtils ( ) . mapException ( rex , minorCode ) ; } } else { mappedException = rex ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "mapCSIException returning: " + mappedException ) ; } return mappedException ; } | 150727 - rewrote most of this method and changed signature . |
24,570 | private Exception mapEJBException ( EJSDeployedSupport s , EJBException e ) throws CSIException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "mapEJBException: " + e ) ; } Exception mappedException = null ; String message = " " ; RemoteException rex ; if ( e instanceof TransactionRolledbackLocalException ) { rex = new TransactionRolledbackException ( message ) ; } else if ( e instanceof AccessLocalException ) { rex = new AccessException ( message ) ; } else if ( e instanceof InvalidTransactionLocalException ) { rex = new InvalidTransactionException ( message ) ; } else if ( e instanceof NoSuchObjectLocalException ) { rex = new NoSuchObjectException ( message ) ; } else if ( e instanceof TransactionRequiredLocalException ) { rex = new TransactionRequiredException ( message ) ; } else { rex = new RemoteException ( message ) ; } rex . detail = s . rootEx ; rex . setStackTrace ( s . rootEx . getStackTrace ( ) ) ; if ( s . ivWrapper . ivInterface . ivORB ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "mapEJBException calling OrbUtils.mapException: " + rex ) ; } mappedException = getOrbUtils ( ) . mapException ( rex ) ; } else { mappedException = rex ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , "mapEJBException returning: " + mappedException ) ; } return mappedException ; } | 150727 - added entire method . |
24,571 | public Token getFirst ( Transaction transaction ) throws ObjectManagerException { Iterator iterator = iterator ( ) ; return ( Token ) iterator . next ( transaction ) ; } | Retrieves but does not delete the first entry in the list visible to a transaction . |
24,572 | public static String addParameters ( ExternalContext externalContext , String url , boolean addRequestParameter , boolean addPageParameter , boolean encodeValues ) { StringBuilder finalUrl = new StringBuilder ( url ) ; boolean existingParameters = url . contains ( "?" ) ; boolean urlContainsWindowId = url . contains ( ResponseStateManager . CLIENT_WINDOW_URL_PARAM + "=" ) ; return finalUrl . toString ( ) ; } | Adds the current request - parameters to the given url |
24,573 | public Object next ( ) { if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "next" ) ; } Object result ; if ( hasNext ( ) ) { AnycastInputHandler aih = ( AnycastInputHandler ) anycastIHIterator . next ( ) ; result = aih . getControlAdapter ( ) ; } else { result = null ; } if ( tc . isEntryEnabled ( ) ) { SibTr . exit ( tc , "next" , result ) ; } return result ; } | This method returns the attached remote subscriber control or null if there isn t one . |
24,574 | public int discriminate ( VirtualConnection vc , Object discrimData , ConnectionLink prevChannelLink ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "discriminate: " + vc ) ; } ConnectionLink nextChannelLink = nextChannel . getConnectionLink ( vc ) ; prevChannelLink . setApplicationCallback ( nextChannelLink ) ; nextChannelLink . setDeviceLink ( prevChannelLink ) ; return DiscriminationProcess . SUCCESS ; } | Use a VirtualConnection rather than a InboundVirtualConnection for discrimination |
24,575 | protected MetaRuleset createMetaRuleset ( Class type ) { ParameterCheck . notNull ( "type" , type ) ; return new MetaRulesetImpl ( this . tag , type ) ; } | Extend this method in order to add your own rules . |
24,576 | public void setThrown ( Throwable thrown ) { if ( thrown != null ) { super . setThrown ( thrown ) ; this . ivStackTrace = DataFormatHelper . throwableToString ( thrown ) ; } } | Set a throwable associated with the log event . |
24,577 | public static WsLogRecord createWsLogRecord ( TraceComponent tc , Level level , String msg , Object [ ] msgParms ) { WsLogRecord retMe = new WsLogRecord ( level , msg ) ; retMe . setLoggerName ( tc . getName ( ) ) ; retMe . setParameters ( msgParms ) ; retMe . setTraceClass ( tc . getTraceClass ( ) ) ; retMe . setResourceBundleName ( tc . getResourceBundleName ( ) ) ; if ( level . intValue ( ) >= Level . INFO . intValue ( ) ) { retMe . setLocalizable ( REQUIRES_LOCALIZATION ) ; } else { retMe . setLocalizable ( REQUIRES_NO_LOCALIZATION ) ; } return retMe ; } | Static method constructs a WsLogRecord object using the given parameters . This bridges Tr - based trace and Logger based trace |
24,578 | public boolean isCancelled ( ) { if ( svLogger . isLoggable ( Level . FINER ) ) svLogger . logp ( Level . FINER , CLASS_NAME , "isCancelled" , toString ( ) ) ; return ( ivCancellationException != null ) ; } | This method allows clients to check the Future object to see if the asynchronous method was canceled before it got a chance to execute . |
24,579 | private Object waitForResult ( long timeoutMillis ) throws ExecutionException , InterruptedException , TimeoutException , RemoteException { final boolean isTraceOn = svLogger . isLoggable ( Level . FINER ) ; if ( isTraceOn ) svLogger . entering ( CLASS_NAME , "waitForResult" , Long . valueOf ( timeoutMillis ) ) ; long begin = System . nanoTime ( ) ; long beginLastAttempt = begin ; long end = begin + TimeUnit . MILLISECONDS . toNanos ( timeoutMillis ) ; boolean noResponse = false ; long waitTimeMillis = timeoutMillis ; long maxWaitTimeMillis = - 1 ; for ( ; ; ) { if ( isTraceOn ) svLogger . entering ( CLASS_NAME , "waitForResult" , "waiting " + waitTimeMillis ) ; Object [ ] resultArray ; try { resultArray = stubWaitForResult ( ( Stub ) ivServer , waitTimeMillis ) ; } catch ( RemoteException ex ) { Throwable cause = ex . getCause ( ) ; if ( cause instanceof NO_RESPONSE && ! noResponse ) { if ( isTraceOn ) svLogger . logp ( Level . FINER , CLASS_NAME , "waitForResult" , "retrying" , cause ) ; resultArray = null ; noResponse = true ; } else { if ( isTraceOn ) svLogger . exiting ( CLASS_NAME , "waitForResult" , ex ) ; throw ex ; } } if ( resultArray != null ) { if ( isTraceOn ) svLogger . exiting ( CLASS_NAME , "waitForResult" , "result" ) ; return resultArray [ 0 ] ; } long now = System . nanoTime ( ) ; if ( timeoutMillis > 0 ) { long remainingMillis = TimeUnit . NANOSECONDS . toMillis ( end - now ) ; if ( remainingMillis <= 0 ) { if ( isTraceOn ) svLogger . exiting ( CLASS_NAME , "waitForResult" , "timeout" ) ; throw new TimeoutException ( ) ; } waitTimeMillis = remainingMillis ; } if ( noResponse ) { if ( maxWaitTimeMillis == - 1 ) { long actualWaitTimeMillis = TimeUnit . NANOSECONDS . toMillis ( now - beginLastAttempt ) ; maxWaitTimeMillis = Math . max ( MIN_ASYNC_RESULT_NO_RESPONSE_WAIT_TIME , actualWaitTimeMillis - AsyncResultNoResponseBackoff ) ; } if ( timeoutMillis == 0 ) { waitTimeMillis = maxWaitTimeMillis ; } else { waitTimeMillis = Math . min ( waitTimeMillis , maxWaitTimeMillis ) ; } } beginLastAttempt = now ; } } | Waits for a result using RemoteAsyncResultExtended . |
24,580 | public void prepare ( ) throws SIDiscriminatorSyntaxException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "prepare" ) ; patternIsWildcarded = mpm . isWildCarded ( destinationNamePatternString ) ; if ( patternIsWildcarded ) { wildcardStem = mpm . retrieveNonWildcardStem ( destinationNamePatternString ) ; parsedPattern = mpm . parseDiscriminator ( destinationNamePatternString ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "prepare" ) ; } | If a pattern is wildcarded we csn parse it up front . |
24,581 | public boolean match ( String destinationName ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "match" , destinationName ) ; boolean matches = false ; if ( ! patternIsWildcarded ) { matches = destinationName . equals ( destinationNamePatternString ) ; } else { if ( destinationName . startsWith ( wildcardStem ) ) { try { matches = mpm . evaluateDiscriminator ( destinationName , destinationNamePatternString , parsedPattern ) ; } catch ( SIDiscriminatorSyntaxException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.impl.DestinationNamePattern.match" , "1:141:1.2" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "match" , "SIErrorException" ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.DestinationNamePattern" , "1:152:1.2" , e } ) ; throw new SIErrorException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.impl.DestinationNamePattern" , "1:160:1.2" , e } , null ) , e ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "match" , Boolean . valueOf ( matches ) ) ; return matches ; } | Match a string against the pattern represented by this object . |
24,582 | protected final SQLRecoverableException createClosedException ( String ifc ) { String message = AdapterUtil . getNLSMessage ( "OBJECT_CLOSED" , ifc ) ; return new SQLRecoverableException ( message , "08003" , 0 ) ; } | Create an SQLRecoverableException if exception mapping is enabled or SQLRecoverableException if exception mapping is disabled . |
24,583 | Object invokeOperation ( Object implObject , Method method , Object [ ] args ) throws IllegalAccessException , IllegalArgumentException , InvocationTargetException , SQLException { TraceComponent tc = getTracer ( ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "invoking " + AdapterUtil . toString ( implObject ) + "." + method . getName ( ) ) ; return method . invoke ( implObject , args ) ; } | Invokes a method on the specified object . The data source must override this method to account for dynamic configuration changes . |
24,584 | public boolean isWrapperFor ( Class < ? > interfaceClass ) throws SQLException { TraceComponent tc = getTracer ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "isWrapperFor" , interfaceClass ) ; boolean isWrapper ; try { activate ( ) ; isWrapper = interfaceClass . isInterface ( ) && ( interfaceClass . isInstance ( this ) || ( ( mcf . jdbcDriverSpecVersion >= 40 && ! ( this instanceof CommonDataSource ) ) ? ( ( Wrapper ) WSJdbcTracer . getImpl ( getJDBCImplObject ( ) ) ) . isWrapperFor ( interfaceClass ) : getJDBCImplObject ( interfaceClass ) != null ) ) ; } catch ( SQLException sqlX ) { FFDCFilter . processException ( sqlX , getClass ( ) . getName ( ) + ".isWrapperFor" , "296" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "isWrapperFor" , sqlX ) ; throw WSJdbcUtil . mapException ( this , sqlX ) ; } catch ( NullPointerException nullX ) { throw runtimeXIfNotClosed ( nullX ) ; } catch ( RuntimeException runX ) { FFDCFilter . processException ( runX , getClass ( ) . getName ( ) + ".isWrapperFor" , "307" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "isWrapperFor" , runX ) ; throw runX ; } catch ( Error err ) { FFDCFilter . processException ( err , getClass ( ) . getName ( ) + ".isWrapperFor" , "314" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "isWrapperFor" , err ) ; throw err ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "isWrapperFor" , isWrapper ? Boolean . TRUE : Boolean . FALSE ) ; return isWrapper ; } | Finds out if unwrap can be successfully invoked for the specified interface . |
24,585 | @ SuppressWarnings ( "unchecked" ) public < T > T unwrap ( final Class < T > interfaceClass ) throws SQLException { TraceComponent tc = getTracer ( ) ; if ( tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "unwrap" , interfaceClass ) ; activate ( ) ; Object result ; if ( interfaceClass . isInstance ( this ) ) result = this ; else if ( ifcToDynamicWrapper . containsKey ( interfaceClass ) ) result = ifcToDynamicWrapper . get ( interfaceClass ) ; else try { if ( tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "No existing wrappers found. Need to create a new wrapper." ) ; Object implObject = getJDBCImplObject ( interfaceClass ) ; if ( implObject == null || ! interfaceClass . isInterface ( ) ) { throw new SQLException ( AdapterUtil . getNLSMessage ( "NO_WRAPPED_OBJECT" , this , interfaceClass . getName ( ) ) ) ; } if ( tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "Creating a wrapper for:" , AdapterUtil . toString ( implObject ) ) ; result = AccessController . doPrivileged ( new PrivilegedAction < Object > ( ) { public Object run ( ) { return Proxy . newProxyInstance ( interfaceClass . getClassLoader ( ) , new Class [ ] { interfaceClass } , WSJdbcWrapper . this ) ; } } ) ; ifcToDynamicWrapper . put ( interfaceClass , result ) ; dynamicWrapperToImpl . put ( result , implObject ) ; } catch ( SQLException sqlX ) { FFDCFilter . processException ( sqlX , getClass ( ) . getName ( ) + ".unwrap" , "441" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "unwrap" , sqlX ) ; throw WSJdbcUtil . mapException ( this , sqlX ) ; } catch ( NullPointerException nullX ) { throw runtimeXIfNotClosed ( nullX ) ; } catch ( RuntimeException runX ) { FFDCFilter . processException ( runX , getClass ( ) . getName ( ) + ".unwrap" , "451" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "unwrap" , runX ) ; throw runX ; } catch ( Error err ) { FFDCFilter . processException ( err , getClass ( ) . getName ( ) + ".unwrap" , "458" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "unwrap" , err ) ; throw err ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( this , tc , "unwrap" , result ) ; return ( T ) result ; } | Return a class that implements the requested interface if possible . |
24,586 | private String getRealmName ( ) { String realm = "defaultRealm" ; try { UserRegistry ur = RegistryHelper . getUserRegistry ( null ) ; if ( ur != null ) { String r = ur . getRealm ( ) ; if ( r != null ) { realm = r ; } } } catch ( Exception ex ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Cannot get the UR service since it may not be available so use the default value for the realm." , ex ) ; } } return realm ; } | Obtains the realm name of the configured UserRegistry if one is available . |
24,587 | static String getContextName ( String name ) { int index = name . lastIndexOf ( '/' ) ; return index == - 1 ? "" : name . substring ( 0 , index ) ; } | Return the context |
24,588 | public void bind ( String name , T binding ) { put ( name , binding ) ; Map < String , Map < String , NameClassPair > > bindingsByContext = this . contextBindings ; if ( bindingsByContext != null ) { addContextBinding ( bindingsByContext , name , binding ) ; } Set < String > contexts = this . contexts ; if ( contexts != null ) { contexts . add ( getContextName ( name ) ) ; } } | Adds a binding . |
24,589 | public T lookup ( String name ) throws NamingException { T binding = super . get ( name ) ; if ( binding != null ) { return binding ; } String contextName = name ; while ( ! ( contextName = getContextName ( contextName ) ) . isEmpty ( ) ) { if ( containsKey ( contextName ) ) { throw new NotContextException ( namespace + "/" + contextName ) ; } } return null ; } | Looks up a binding . |
24,590 | public void setEnterpriseBean ( Object bean ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setEnterpriseBean : " + Util . identity ( bean ) ) ; ivEjbInstance = bean ; } | Set the actual bean instance . The instance variable should only be set by this method allowing subclasses to override and perform additional setup when the instance is set . |
24,591 | private void createInterceptors ( InterceptorMetaData imd ) { ivInterceptors = new Object [ imd . ivInterceptorClasses . length ] ; try { imd . createInterceptorInstances ( getInjectionEngine ( ) , ivInterceptors , ivEjbManagedObjectContext , this ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + ".ManagedBeanOBase" , "177" , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "interceptor creation failure" , t ) ; throw ExceptionUtil . EJBException ( "Interceptor creation failure" , t ) ; } } | Creates and the interceptor instances for the bean . |
24,592 | protected void injectInstance ( ManagedObject < ? > managedObject , Object instance , InjectionTargetContext injectionContext ) throws EJBException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "injectInstance : " + Util . identity ( managedObject ) + ", " + injectionContext ) ; BeanMetaData bmd = home . beanMetaData ; if ( bmd . ivBeanInjectionTargets != null ) { try { if ( managedObject != null ) { managedObject . inject ( bmd . ivBeanInjectionTargets , injectionContext ) ; } else { InjectionEngine injectionEngine = getInjectionEngine ( ) ; for ( InjectionTarget injectionTarget : bmd . ivBeanInjectionTargets ) { injectionEngine . inject ( ivEjbInstance , injectionTarget , injectionContext ) ; } } } catch ( Throwable t ) { if ( ! ( t instanceof ManagedObjectException ) ) { FFDCFilter . processException ( t , CLASS_NAME + ".injectInstance" , "151" , this ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "injectInstance : Injection failure" , t ) ; throw ExceptionUtil . EJBException ( "Injection failure" , t ) ; } else { Throwable cause = t . getCause ( ) ; FFDCFilter . processException ( cause , CLASS_NAME + ".injectInstance" , "157" , this ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "injectInstance : Injection failure" , cause ) ; throw ExceptionUtil . EJBException ( "Injection failure" , cause ) ; } } } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "injectInstance" ) ; } | Performs resource injection for the managed object instance . |
24,593 | protected void createInterceptorsAndInstance ( CallbackContextHelper contextHelper ) throws InvocationTargetException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createInterceptorsAndInstance : " + contextHelper ) ; BeanMetaData bmd = home . beanMetaData ; ManagedObjectFactory < ? > managedObjectFactory = bmd . ivEnterpriseBeanFactory ; if ( managedObjectFactory != null ) { try { ivEjbManagedObjectContext = managedObjectFactory . createContext ( ) ; } catch ( ManagedObjectException e ) { throw ExceptionUtil . EJBException ( "AroundConstruct interceptors for the " + bmd . enterpriseBeanName + " bean in the " + bmd . _moduleMetaData . ivName + " module in the " + bmd . _moduleMetaData . ivAppName + " application resulted in an exception being thrown from the ManagedObjectFactory.createContext() method" , e ) ; } } InterceptorMetaData imd = bmd . ivInterceptorMetaData ; if ( imd != null && ! bmd . managedObjectManagesInjectionAndInterceptors ) { createInterceptors ( imd ) ; if ( bmd . ivCallbackKind == CallbackKind . InvocationContext ) { InterceptorProxy [ ] aroundConstructProxies = imd . ivAroundConstructInterceptors ; if ( aroundConstructProxies != null ) { InvocationContextImpl < ? > context = callAroundConstructInterceptors ( aroundConstructProxies , contextHelper ) ; if ( ivEjbInstance == null ) { if ( context . ivAroundConstructException != null ) { Throwable t = context . ivAroundConstructException . getCause ( ) ; if ( t == null ) { t = context . ivAroundConstructException ; } throw ExceptionUtil . EJBException ( "AroundConstruct interceptors for the " + bmd . enterpriseBeanName + " bean in the " + bmd . _moduleMetaData . ivName + " module in the " + bmd . _moduleMetaData . ivAppName + " application resulted in an exception being thrown from the constructor of the " + bmd . enterpriseBeanClassName + " class." , t ) ; } throw new EJBException ( "AroundConstruct interceptors for the " + bmd . enterpriseBeanName + " bean in the " + bmd . _moduleMetaData . ivName + " module in the " + bmd . _moduleMetaData . ivAppName + " application did not call InvocationContext.proceed()" ) ; } } } } if ( ivEjbInstance == null ) { createInstance ( ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createInterceptorsAndInstance" ) ; } | Method for creating interceptors prior to the creation of the bean instance in case |
24,594 | private void createInstance ( ) throws InvocationTargetException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createInstance" ) ; ManagedObjectFactory < ? > ejbManagedObjectFactory = home . beanMetaData . ivEnterpriseBeanFactory ; if ( ejbManagedObjectFactory != null ) { createInstanceUsingMOF ( ejbManagedObjectFactory ) ; } else { createInstanceUsingConstructor ( ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createInstance" ) ; } | Creates the bean instance using either the ManagedObjectFactory or constructor . |
24,595 | @ SuppressWarnings ( "unchecked" ) private void createInstanceUsingMOF ( ManagedObjectFactory < ? > ejbManagedObjectFactory ) throws InvocationTargetException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createInstanceUsingMOF" ) ; try { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "calling ManagedObjectFactory.createManagedObject(InvocationContext)" ) ; @ SuppressWarnings ( "rawtypes" ) InvocationContextImpl invCtx = getInvocationContext ( ) ; ivManagedObject = ejbManagedObjectFactory . createManagedObject ( invCtx ) ; ivEjbManagedObjectContext = ivManagedObject . getContext ( ) ; setEnterpriseBean ( ivManagedObject . getObject ( ) ) ; } catch ( ManagedObjectException e ) { Throwable cause = e . getCause ( ) ; if ( cause != null && cause instanceof Exception ) { if ( cause instanceof InvocationTargetException ) { throw ( InvocationTargetException ) cause ; } else { throw new InvocationTargetException ( cause ) ; } } else { throw new EJBException ( home . beanMetaData . enterpriseBeanClassName , e ) ; } } catch ( Exception e ) { FFDCFilter . processException ( e , CLASS_NAME + ".createInstanceUsingMOF" , "321" , this ) ; throw new EJBException ( home . beanMetaData . enterpriseBeanClassName , e ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createInstanceUsingMOF" ) ; } | Creates the bean instance using either the ManagedObjectFactory . |
24,596 | private void createInstanceUsingConstructor ( ) throws InvocationTargetException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "createInstanceUsingConstructor" ) ; try { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "calling Constructor.newInstance" ) ; Constructor < ? > con = home . beanMetaData . getEnterpriseBeanClassConstructor ( ) ; setEnterpriseBean ( con . newInstance ( ) ) ; } catch ( InvocationTargetException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".createInstanceUsingConstructor" , "360" , this ) ; throw e ; } catch ( Exception e ) { FFDCFilter . processException ( e , CLASS_NAME + ".createInstanceUsingConstructor" , "364" , this ) ; throw new EJBException ( home . beanMetaData . enterpriseBeanClassName , e ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "createInstanceUsingConstructor" ) ; } | Creates the bean instance using the constructor . |
24,597 | private void optimize ( final Subject subject ) { if ( System . getSecurityManager ( ) == null ) subject . setReadOnly ( ) ; else AccessController . doPrivileged ( new PrivilegedAction < Void > ( ) { public Void run ( ) { subject . setReadOnly ( ) ; return null ; } } ) ; } | To optimize the subject the subject must be marked as read only and be placed in the cache . |
24,598 | private synchronized void start ( ) { if ( scheduledFuture == null && monitorState . get ( ) == MonitorState . ACTIVE . ordinal ( ) && ! updateMonitors . isEmpty ( ) && monitorInterval != 0 && FrameworkState . isValid ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Scan task scheduled" ) ; } scheduledFuture = coreService . getScheduler ( ) . scheduleWithFixedDelay ( this , monitorInterval , monitorInterval , monitorTimeUnit ) ; } } | Start monitoring the file collection |
24,599 | private boolean doDestroy ( ) { if ( scanLock . tryLock ( ) ) { try { if ( monitorState . compareAndSet ( MonitorState . DESTROY . ordinal ( ) , MonitorState . DESTROYED . ordinal ( ) ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Destroy file monitor" ) ; } for ( UpdateMonitor m : updateMonitors . keySet ( ) ) { m . destroy ( ) ; } updateMonitors . clear ( ) ; unnotifiedFileCreates . clear ( ) ; unnotifiedFileDeletes . clear ( ) ; unnotifiedFileModifies . clear ( ) ; return true ; } } finally { scanLock . unlock ( ) ; } } return monitorState . get ( ) == MonitorState . DESTROYED . ordinal ( ) ; } | Will actually destroy the monitors if and only if the monitor state has already been set to DESTROY . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.