idx
int64 0
165k
| question
stringlengths 73
4.15k
| target
stringlengths 5
918
| len_question
int64 21
890
| len_target
int64 3
255
|
|---|---|---|---|---|
160,100
|
public static Document parseDocument ( DocumentBuilder builder , File file ) throws IOException , SAXException { final DocumentBuilder docBuilder = builder ; final File parsingFile = file ; try { return ( Document ) AccessController . doPrivileged ( new PrivilegedExceptionAction ( ) { public Object run ( ) throws SAXException , IOException { Thread currThread = Thread . currentThread ( ) ; ClassLoader oldLoader = currThread . getContextClassLoader ( ) ; currThread . setContextClassLoader ( ParserFactory . class . getClassLoader ( ) ) ; try { return docBuilder . parse ( parsingFile ) ; } finally { currThread . setContextClassLoader ( oldLoader ) ; } } } ) ; } catch ( PrivilegedActionException pae ) { Throwable t = pae . getCause ( ) ; if ( t instanceof SAXException ) { throw ( SAXException ) t ; } else if ( t instanceof IOException ) { throw ( IOException ) t ; } } return null ; }
|
D190462 - START
| 218
| 6
|
160,101
|
protected boolean checkBuffer ( ) throws IOException { if ( ! enableMultiReadofPostData ) { if ( null != this . buffer ) { if ( this . buffer . hasRemaining ( ) ) { return true ; } this . buffer . release ( ) ; this . buffer = null ; } try { this . buffer = this . isc . getRequestBodyBuffer ( ) ; if ( null != this . buffer ) { // record the new amount of data read from the channel this . bytesRead += this . buffer . remaining ( ) ; // Tr.debug(tc, "Buffer=" + WsByteBufferUtils.asString(this.buffer)); return true ; } return false ; } catch ( IOException e ) { this . error = e ; throw e ; } } else { return checkMultiReadBuffer ( ) ; } }
|
Check the input buffer for data . If necessary attempt a read for a new buffer .
| 176
| 17
|
160,102
|
private boolean checkMultiReadBuffer ( ) throws IOException { //first check existing buffer if ( null != this . buffer ) { if ( this . buffer . hasRemaining ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "checkMultiReadBuffer, remaining ->" + this ) ; } return true ; } if ( firstReadCompleteforMulti ) { // multiRead enabled and subsequent read if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "checkMultiReadBuffer, buffer is completely read, ready this buffer for the subsequent read ->" + this ) ; } postDataBuffer . get ( postDataIndex ) . flip ( ) ; // make position 0 , to read it again from start postDataIndex ++ ; } else { this . buffer . release ( ) ; } this . buffer = null ; } // no buffer read from store or first read of buffer if ( firstReadCompleteforMulti ) { // first read from what we have stored, if need more than go to channel if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "checkMultiReadBuffer ,index ->" + postDataIndex + " ,storage.size ->" + postDataBuffer . size ( ) ) ; } if ( postDataBuffer . size ( ) <= postDataIndex ) { //get remaining from channel now as read needs more than the stored readRemainingFromChannel ( ) ; } if ( postDataBuffer . size ( ) > postDataIndex ) { this . buffer = postDataBuffer . get ( postDataIndex ) ; } if ( null != this . buffer ) { // record the new amount of data read from the store this . bytesReadFromStore += this . buffer . remaining ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "checkMultiReadBuffer ->" + this ) ; } return true ; } } else { // multiRead enabled and first read if ( getBufferFromChannel ( ) ) { // store the channel buffer postDataBuffer . add ( postDataIndex , this . buffer . duplicate ( ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "checkMultiReadBuffer, buffer ->" + postDataBuffer . get ( postDataIndex ) + " ,buffersize ->" + postDataBuffer . size ( ) + " ,index ->" + postDataIndex ) ; } postDataIndex ++ ; // record the new amount of data read from the channel this . bytesRead += this . buffer . remaining ( ) ; return true ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "checkMultiReadBuffer: no more buffer ->" + this ) ; } return false ; }
|
Check the input buffer for data . If necessary attempt a read for a new buffer and store it .
| 650
| 20
|
160,103
|
public static EsaSubsystemFeatureDefinitionImpl constructInstance ( File esa ) throws ZipException , IOException { // Find the manifest - case isn't guaranteed so do a search ZipFile zip = new ZipFile ( esa ) ; Enumeration < ? extends ZipEntry > zipEntries = zip . entries ( ) ; ZipEntry subsystemEntry = null ; while ( zipEntries . hasMoreElements ( ) ) { ZipEntry nextEntry = zipEntries . nextElement ( ) ; if ( "OSGI-INF/SUBSYSTEM.MF" . equalsIgnoreCase ( nextEntry . getName ( ) ) ) { subsystemEntry = nextEntry ; } } return new EsaSubsystemFeatureDefinitionImpl ( zip . getInputStream ( subsystemEntry ) , zip ) ; }
|
Create a new instance of this class for the supplied ESA file .
| 166
| 13
|
160,104
|
static String formatTime ( ) { Date date = new Date ( ) ; DateFormat formatter = BaseTraceFormatter . useIsoDateFormat ? new SimpleDateFormat ( "yyyy-MM-dd'T'HH:mm:ss.SSSZ" ) : DateFormatProvider . getDateFormat ( ) ; StringBuffer answer = new StringBuffer ( ) ; answer . append ( ' ' ) ; formatter . format ( date , answer , new FieldPosition ( 0 ) ) ; answer . append ( ' ' ) ; return answer . toString ( ) ; }
|
Return the current time formatted in a standard way
| 121
| 9
|
160,105
|
private static String [ ] getCallStackFromStackTraceElement ( StackTraceElement [ ] exceptionCallStack ) { if ( exceptionCallStack == null ) return null ; String [ ] answer = new String [ exceptionCallStack . length ] ; for ( int i = 0 ; i < exceptionCallStack . length ; i ++ ) { answer [ exceptionCallStack . length - 1 - i ] = exceptionCallStack [ i ] . getClassName ( ) ; } return answer ; }
|
Create the call stack array expected by diagnostic modules from an array of StackTraceElements
| 101
| 18
|
160,106
|
private static String getPackageName ( String className ) { int end = className . lastIndexOf ( ' ' ) ; return ( end > 0 ) ? className . substring ( 0 , end ) : "" ; }
|
Return the package name of a given class name
| 47
| 9
|
160,107
|
public String validateCookieName ( String cookieName , boolean quiet ) { if ( cookieName == null || cookieName . length ( ) == 0 ) { if ( ! quiet ) { Tr . error ( tc , "COOKIE_NAME_CANT_BE_EMPTY" ) ; } return CFG_DEFAULT_COOKIENAME ; } String cookieNameUc = cookieName . toUpperCase ( ) ; boolean valid = true ; for ( int i = 0 ; i < cookieName . length ( ) ; i ++ ) { String eval = cookieNameUc . substring ( i , i + 1 ) ; if ( ! validCookieChars . contains ( eval ) ) { if ( ! quiet ) { Tr . error ( tc , "COOKIE_NAME_INVALID" , new Object [ ] { cookieName , eval } ) ; } valid = false ; } } if ( ! valid ) { return CFG_DEFAULT_COOKIENAME ; } else { return cookieName ; } }
|
reset cookieName to default value if it is not valid
| 221
| 11
|
160,108
|
public void distributeBefore ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "distributeBefore" , this ) ; boolean setRollback = false ; try { coreDistributeBefore ( ) ; } catch ( Throwable exc ) { // No FFDC Code Needed. Tr . error ( tc , "WTRN0074_SYNCHRONIZATION_EXCEPTION" , new Object [ ] { "before_completion" , exc } ) ; // PK19059 starts here _tran . setOriginalException ( exc ) ; // PK19059 ends here setRollback = true ; } // Finally issue the RRS syncs - z/OS always issues these even if RBO has occurred // during previous syncs. Need to check with Matt if we need to do these even if the // overall transaction is set to RBO as we bypass distributeBefore in this case. final List RRSsyncs = _syncs [ SYNC_TIER_RRS ] ; if ( RRSsyncs != null ) { for ( int j = 0 ; j < RRSsyncs . size ( ) ; j ++ ) // d162354 array could grow { final Synchronization sync = ( Synchronization ) RRSsyncs . get ( j ) ; if ( tc . isEventEnabled ( ) ) Tr . event ( tc , "driving RRS before sync[" + j + "]" , Util . identity ( sync ) ) ; try { sync . beforeCompletion ( ) ; } catch ( Throwable exc ) { // No FFDC Code Needed. Tr . error ( tc , "WTRN0074_SYNCHRONIZATION_EXCEPTION" , new Object [ ] { "before_completion" , exc } ) ; setRollback = true ; } } // If RRS syncs, one may be DB2 type 2, so issue thread switch // NativeJDBCDriverHelper.threadSwitch(); /* @367977A*/ } //---------------------------------------------------------- // If we've encountered an error, try to set rollback only //---------------------------------------------------------- if ( setRollback && _tran != null ) { try { _tran . setRollbackOnly ( ) ; } catch ( Exception ex ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setRollbackOnly raised exception" , ex ) ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeBefore" ) ; }
|
Distributes before completion operations to all registered Synchronization objects . If a synchronization raises an exception mark transaction for rollback .
| 532
| 25
|
160,109
|
public void distributeAfter ( int status ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "distributeAfter" , new Object [ ] { this , status } ) ; // Issue the RRS syncs first - these need to be as close to the completion as possible final List RRSsyncs = _syncs [ SYNC_TIER_RRS ] ; if ( RRSsyncs != null ) { final int RRSstatus = ( status == Status . STATUS_UNKNOWN ? Status . STATUS_COMMITTED : status ) ; // @281425A for ( int j = RRSsyncs . size ( ) ; -- j >= 0 ; ) { final Synchronization sync = ( Synchronization ) RRSsyncs . get ( j ) ; try { if ( tc . isEntryEnabled ( ) ) Tr . event ( tc , "driving RRS after sync[" + j + "]" , Util . identity ( sync ) ) ; sync . afterCompletion ( RRSstatus ) ; // @281425C } catch ( Throwable exc ) { // No FFDC Code Needed. // Discard any exceptions at this point. Tr . error ( tc , "WTRN0074_SYNCHRONIZATION_EXCEPTION" , new Object [ ] { "after_completion" , exc } ) ; } } } coreDistributeAfter ( status ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "distributeAfter" ) ; }
|
Distributes after completion operations to all registered Synchronization objects .
| 329
| 13
|
160,110
|
public static UDPBufferFactory getRef ( ) { if ( null == ofInstance ) { synchronized ( UDPBufferFactory . class ) { if ( null == ofInstance ) { ofInstance = new UDPBufferFactory ( ) ; } } } return ofInstance ; }
|
Get a reference to the singleton instance of this class .
| 53
| 12
|
160,111
|
public static UDPBufferImpl getUDPBuffer ( WsByteBuffer buffer , SocketAddress address ) { UDPBufferImpl udpBuffer = getRef ( ) . getUDPBufferImpl ( ) ; udpBuffer . set ( buffer , address ) ; return udpBuffer ; }
|
Get a UDPBuffer that will encapsulate the provided information .
| 58
| 12
|
160,112
|
protected UDPBufferImpl getUDPBufferImpl ( ) { UDPBufferImpl ret = ( UDPBufferImpl ) udpBufferObjectPool . get ( ) ; if ( ret == null ) { ret = new UDPBufferImpl ( this ) ; } return ret ; }
|
Retrieve an UDPBuffer object from the factory .
| 54
| 10
|
160,113
|
public String logDirectory ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "logDirectory" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "logDirectory" , _logDirectory ) ; return _logDirectory ; }
|
Returns the physical location where a recovery log constructed from the target object will reside .
| 63
| 16
|
160,114
|
public String logDirectoryStem ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "logDirectoryStem" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "logDirectoryStem" , _logDirectoryStem ) ; return _logDirectoryStem ; }
|
Returns the stem of the location where a recovery log constructed from the target object will reside .
| 73
| 18
|
160,115
|
public int logFileSize ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "logFileSize" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "logFileSize" , new Integer ( _logFileSize ) ) ; return _logFileSize ; }
|
Returns the physical log size of a recovery log constructed from the target object .
| 72
| 15
|
160,116
|
public int maxLogFileSize ( ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "maxLogFileSize" , this ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "maxLogFileSize" , new Integer ( _maxLogFileSize ) ) ; return _maxLogFileSize ; }
|
Returns the maximum physical log size of a recovery log constructed from the target object .
| 77
| 16
|
160,117
|
void unregister ( ) { trackerLock . lock ( ) ; try { if ( tracker != null ) { // simply closing the tracker causes the services to be unregistered tracker . close ( ) ; tracker = null ; } } finally { trackerLock . unlock ( ) ; } }
|
Unregisters all OSGi services associated with this bell
| 57
| 11
|
160,118
|
void update ( ) { final BundleContext context = componentContext . getBundleContext ( ) ; // determine the service filter to use for discovering the Library service this bell is for String libraryRef = library . id ( ) ; // it is unclear if only looking at the id would work here. // other examples in classloading use both id and service.pid to look up so doing the same here. String libraryStatusFilter = String . format ( "(&(objectClass=%s)(|(id=%s)(service.pid=%s)))" , Library . class . getName ( ) , libraryRef , libraryRef ) ; Filter filter ; try { filter = context . createFilter ( libraryStatusFilter ) ; } catch ( InvalidSyntaxException e ) { // should not happen, but blow up if it does throw new RuntimeException ( e ) ; } final Set < String > serviceNames = getServiceNames ( ( String [ ] ) config . get ( SERVICE_ATT ) ) ; // create a tracker that will register the services once the library becomes available ServiceTracker < Library , List < ServiceRegistration < ? > > > newTracker = null ; newTracker = new ServiceTracker < Library , List < ServiceRegistration < ? > > > ( context , filter , new ServiceTrackerCustomizer < Library , List < ServiceRegistration < ? > > > ( ) { @ Override public List < ServiceRegistration < ? > > addingService ( ServiceReference < Library > libraryRef ) { Library library = context . getService ( libraryRef ) ; // Got the library now register the services. // The list of registrations is returned so we don't have to store them ourselves. return registerLibraryServices ( library , serviceNames ) ; } @ Override public void modifiedService ( ServiceReference < Library > libraryRef , List < ServiceRegistration < ? > > metaInfServices ) { // don't care } @ Override @ FFDCIgnore ( IllegalStateException . class ) public void removedService ( ServiceReference < Library > libraryRef , List < ServiceRegistration < ? > > metaInfServices ) { // THe library is going away; need to unregister the services for ( ServiceRegistration < ? > registration : metaInfServices ) { try { registration . unregister ( ) ; } catch ( IllegalStateException e ) { // ignore; already unregistered } } context . ungetService ( libraryRef ) ; } } ) ; trackerLock . lock ( ) ; try { if ( tracker != null ) { // close the existing tracker so we unregister existing services tracker . close ( ) ; } // store and open the new tracker so we can register the configured services. tracker = newTracker ; tracker . open ( ) ; } finally { trackerLock . unlock ( ) ; } }
|
Configures this bell with a specific library and a possible set of service names
| 571
| 15
|
160,119
|
public static < T extends Constructible > T createObject ( Class < T > clazz ) { return OASFactoryResolver . instance ( ) . createObject ( clazz ) ; }
|
This method creates a new instance of a constructible element from the OpenAPI model tree .
| 39
| 18
|
160,120
|
private void printErrorMessage ( String key , Object ... substitutions ) { Tr . error ( tc , key , substitutions ) ; errorMsgIssued = true ; }
|
Prints the specified error message .
| 35
| 7
|
160,121
|
@ Trivial protected Object evaluateElExpression ( String expression , boolean mask ) { final String methodName = "evaluateElExpression" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , methodName , new Object [ ] { ( expression == null ) ? null : mask ? OBFUSCATED_STRING : expression , mask } ) ; } EvalPrivilegedAction evalPrivilegedAction = new EvalPrivilegedAction ( expression , mask ) ; Object result = AccessController . doPrivileged ( evalPrivilegedAction ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , methodName , ( result == null ) ? null : mask ? OBFUSCATED_STRING : result ) ; } return result ; }
|
Evaluate a possible EL expression .
| 186
| 8
|
160,122
|
@ Trivial static boolean isImmediateExpression ( String expression , boolean mask ) { final String methodName = "isImmediateExpression" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , methodName , new Object [ ] { ( expression == null ) ? null : mask ? OBFUSCATED_STRING : expression , mask } ) ; } boolean result = expression . startsWith ( "${" ) && expression . endsWith ( "}" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , methodName , result ) ; } return result ; }
|
Return whether the expression is an immediate EL expression .
| 154
| 10
|
160,123
|
@ Trivial static String removeBrackets ( String expression , boolean mask ) { final String methodName = "removeBrackets" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , methodName , new Object [ ] { ( expression == null ) ? null : mask ? OBFUSCATED_STRING : expression , mask } ) ; } expression = expression . trim ( ) ; if ( ( expression . startsWith ( "${" ) || expression . startsWith ( "#{" ) ) && expression . endsWith ( "}" ) ) { expression = expression . substring ( 2 , expression . length ( ) - 1 ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . exit ( tc , methodName , ( expression == null ) ? null : mask ? OBFUSCATED_STRING : expression ) ; } return expression ; }
|
Remove the brackets from an EL expression .
| 207
| 8
|
160,124
|
@ SuppressWarnings ( "unchecked" ) private ThreadLocalProxyCopyOnWriteArraySet < ThreadLocalProxy < ? > > getProxySet ( ) { Object property = null ; property = bus . getProperty ( PROXY_SET ) ; if ( property == null ) { ThreadLocalProxyCopyOnWriteArraySet < ThreadLocalProxy < ? > > proxyMap = new ThreadLocalProxyCopyOnWriteArraySet < ThreadLocalProxy < ? > > ( ) ; bus . setProperty ( PROXY_SET , proxyMap ) ; property = proxyMap ; } return ( ThreadLocalProxyCopyOnWriteArraySet < ThreadLocalProxy < ? > > ) property ; }
|
Create a CopyOnWriteArraySet to store the ThreadLocalProxy objects for convenience of clearance
| 141
| 18
|
160,125
|
private void skipClasslessStackFrames ( ) { // skip over any stack trace elements that are unmatched in the classes array if ( classes . isEmpty ( ) ) return ; while ( elements . size ( ) > 0 && ! ! ! elements . peek ( ) . getClassName ( ) . equals ( classes . peek ( ) . getName ( ) ) ) { elements . pop ( ) ; } }
|
Call after any advancement to bring this . elements into line with this . classes .
| 83
| 16
|
160,126
|
public static boolean unregisterExtension ( String key ) { if ( key == null ) { throw new IllegalArgumentException ( "Parameter 'key' can not be null" ) ; } w . lock ( ) ; try { return extensionMap . remove ( key ) != null ; } finally { w . unlock ( ) ; } }
|
Removes context extension registration .
| 69
| 6
|
160,127
|
public static void getExtensions ( Map < String , String > map ) throws IllegalArgumentException { if ( map == null ) { throw new IllegalArgumentException ( "Parameter 'map' can not be null." ) ; } if ( recursion . get ( ) == Boolean . TRUE ) { return ; } recursion . set ( Boolean . TRUE ) ; LinkedList < String > cleanup = new LinkedList < String > ( ) ; r . lock ( ) ; try { for ( Map . Entry < String , WeakReference < Extension > > entry : extensionMap . entrySet ( ) ) { Extension extension = entry . getValue ( ) . get ( ) ; if ( extension == null ) { cleanup . add ( entry . getKey ( ) ) ; } else { String value = extension . getValue ( ) ; if ( value != null ) { map . put ( entry . getKey ( ) , value ) ; } } } } finally { r . unlock ( ) ; recursion . remove ( ) ; } if ( cleanup . size ( ) > 0 ) { w . lock ( ) ; try { for ( String key : cleanup ) { WeakReference < Extension > extension = extensionMap . remove ( key ) ; if ( extension != null && extension . get ( ) != null ) { // Special case! Somebody has put new extension for this // key after we released // read lock and before we took write lock. We need to // put it back. extensionMap . put ( key , extension ) ; } } } finally { w . unlock ( ) ; } } if ( extensions . get ( ) != null ) { for ( Entry < String , String > entry : extensions . get ( ) . entrySet ( ) ) { map . put ( entry . getKey ( ) , entry . getValue ( ) ) ; } } }
|
Retrieves values for all registered context extensions .
| 382
| 10
|
160,128
|
@ FFDCIgnore ( Exception . class ) private void logProviderInfo ( String providerName , ClassLoader loader ) { try { if ( PROVIDER_ECLIPSELINK . equals ( providerName ) ) { // org.eclipse.persistence.Version.getVersion(): 2.6.4.v20160829-44060b6 Class < ? > Version = loadClass ( loader , "org.eclipse.persistence.Version" ) ; String version = ( String ) Version . getMethod ( "getVersionString" ) . invoke ( Version . newInstance ( ) ) ; Tr . info ( tc , "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I" , "EclipseLink" , version ) ; } else if ( PROVIDER_HIBERNATE . equals ( providerName ) ) { // org.hibernate.Version.getVersionString(): 5.2.6.Final Class < ? > Version = loadClass ( loader , "org.hibernate.Version" ) ; String version = ( String ) Version . getMethod ( "getVersionString" ) . invoke ( null ) ; Tr . info ( tc , "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I" , "Hibernate" , version ) ; } else if ( PROVIDER_OPENJPA . equals ( providerName ) ) { // OpenJPAVersion.appendOpenJPABanner(sb): OpenJPA #.#.#\n version id: openjpa-#.#.#-r# \n Apache svn revision: # StringBuilder version = new StringBuilder ( ) ; Class < ? > OpenJPAVersion = loadClass ( loader , "org.apache.openjpa.conf.OpenJPAVersion" ) ; OpenJPAVersion . getMethod ( "appendOpenJPABanner" , StringBuilder . class ) . invoke ( OpenJPAVersion . newInstance ( ) , version ) ; Tr . info ( tc , "JPA_THIRD_PARTY_PROV_INFO_CWWJP0053I" , "OpenJPA" , version ) ; } else { Tr . info ( tc , "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I" , providerName ) ; } } catch ( Exception x ) { Tr . info ( tc , "JPA_THIRD_PARTY_PROV_NAME_CWWJP0052I" , providerName ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "unable to determine provider info" , x ) ; } }
|
Log version information about the specified persistence provider if it can be determined .
| 585
| 14
|
160,129
|
protected void checkStartStatus ( BundleStartStatus startStatus ) throws InvalidBundleContextException { final String m = "checkInstallStatus" ; if ( startStatus . startExceptions ( ) ) { Map < Bundle , Throwable > startExceptions = startStatus . getStartExceptions ( ) ; for ( Entry < Bundle , Throwable > entry : startExceptions . entrySet ( ) ) { Bundle b = entry . getKey ( ) ; FFDCFilter . processException ( entry . getValue ( ) , ME , m , this , new Object [ ] { b . getLocation ( ) } ) ; } throw new LaunchException ( "Exceptions occurred while starting platform bundles" , BootstrapConstants . messages . getString ( "error.platformBundleException" ) ) ; } if ( ! startStatus . contextIsValid ( ) ) throw new InvalidBundleContextException ( ) ; }
|
Check the passed in start status for exceptions starting bundles and issue appropriate diagnostics & messages for this environment .
| 188
| 21
|
160,130
|
protected BundleInstallStatus installBundles ( BootstrapConfig config ) throws InvalidBundleContextException { BundleInstallStatus installStatus = new BundleInstallStatus ( ) ; KernelResolver resolver = config . getKernelResolver ( ) ; ContentBasedLocalBundleRepository repo = BundleRepositoryRegistry . getInstallBundleRepository ( ) ; List < KernelBundleElement > bundleList = resolver . getKernelBundles ( ) ; if ( bundleList == null || bundleList . size ( ) <= 0 ) return installStatus ; boolean libertyBoot = Boolean . parseBoolean ( config . get ( BootstrapConstants . LIBERTY_BOOT_PROPERTY ) ) ; for ( final KernelBundleElement element : bundleList ) { if ( libertyBoot ) { // For boot bundles the LibertyBootRuntime must be used to install the bundles installLibertBootBundle ( element , installStatus ) ; } else { installKernelBundle ( element , installStatus , repo ) ; } } return installStatus ; }
|
Install framework bundles .
| 219
| 4
|
160,131
|
public synchronized boolean isHealthy ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isHealthy" ) ; boolean retval = _running && ! _stopRequested && ( _threadWriteErrorsOutstanding == 0 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "isHealthy" , Boolean . valueOf ( retval ) ) ; return retval ; }
|
Used as a quick way to check the health of a dispatcher before giving it work in situations in which the work cannot be rejected . For example for a transaction which requires both synchronous and asynchronous persistence once we ve done the synchronous persistence a transient persistence problem from a dispatcher will not be reported from the dispatching method because we cannot guarantee to roll back the synchronous work .
| 124
| 75
|
160,132
|
private String getLogDir ( ) { StringBuffer output = new StringBuffer ( ) ; WsLocationAdmin locationAdmin = locationAdminRef . getService ( ) ; output . append ( locationAdmin . resolveString ( "${server.output.dir}" ) . replace ( ' ' , ' ' ) ) . append ( "/logs" ) ; return output . toString ( ) ; }
|
Get the default directory for logs
| 81
| 6
|
160,133
|
private String mapToJSONString ( Map < String , Object > eventMap ) { JSONObject jsonEvent = new JSONObject ( ) ; String jsonString = null ; map2JSON ( jsonEvent , eventMap ) ; try { if ( ! compact ) { jsonString = jsonEvent . serialize ( true ) . replaceAll ( "\\\\/" , "/" ) ; } else { jsonString = jsonEvent . toString ( ) ; } } catch ( IOException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Unexpected error converting AuditEvent to JSON String" , e ) ; } } return jsonString ; }
|
Produce a JSON String for the given audit event
| 149
| 10
|
160,134
|
private JSONArray array2JSON ( JSONArray ja , Object [ ] array ) { for ( int i = 0 ; i < array . length ; i ++ ) { // array entry is a Map if ( array [ i ] instanceof Map ) { //if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { // Tr.debug(tc, "array entry is a Map, calling map2JSON", array[i]); //} ja . add ( map2JSON ( new JSONObject ( ) , ( Map < String , Object > ) array [ i ] ) ) ; } // array entry is an array else if ( array [ i ] . getClass ( ) . isArray ( ) ) { //if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { // Tr.debug(tc, "array entry is a array, calling array2JSON", array[i]); //} ja . add ( array2JSON ( new JSONArray ( ) , ( Object [ ] ) array [ i ] ) ) ; } // else array entry is a "simple" value else { //if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { // Tr.debug(tc, "array entry is a simple value, adding to ja", array[i]); //} ja . add ( array [ i ] ) ; } } return ja ; }
|
Given a Java array add the corresponding JSON to the given JSONArray object
| 299
| 14
|
160,135
|
public void writeBootstrapProperty ( LibertyServer server , String propKey , String propValue ) throws Exception { String bootProps = getBootstrapPropertiesFilePath ( server ) ; appendBootstrapPropertyToFile ( bootProps , propKey , propValue ) ; }
|
Writes the specified bootstrap property and value to the provided server s bootstrap . properties file .
| 57
| 20
|
160,136
|
public void writeBootstrapProperties ( LibertyServer server , Map < String , String > miscParms ) throws Exception { String thisMethod = "writeBootstrapProperties" ; loggingUtils . printMethodName ( thisMethod ) ; if ( miscParms == null ) { return ; } String bootPropFilePath = getBootstrapPropertiesFilePath ( server ) ; for ( Map . Entry < String , String > entry : miscParms . entrySet ( ) ) { appendBootstrapPropertyToFile ( bootPropFilePath , entry . getKey ( ) , entry . getValue ( ) ) ; } }
|
Writes each of the specified bootstrap properties and values to the provided server s bootstrap . properties file .
| 129
| 22
|
160,137
|
public static WSATRecoveryCoordinator fromLogData ( byte [ ] bytes ) throws SystemException { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "fromLogData" , bytes ) ; WSATRecoveryCoordinator wsatRC = null ; final ByteArrayInputStream bais = new ByteArrayInputStream ( bytes ) ; try { final ObjectInputStream ois = new ObjectInputStream ( bais ) ; final Object obj = ois . readObject ( ) ; wsatRC = ( WSATRecoveryCoordinator ) obj ; } catch ( Throwable e ) { FFDCFilter . processException ( e , "com.ibm.ws.Transaction.wstx.WSATRecoveryCoordinator.fromLogData" , "67" ) ; final Throwable se = new SystemException ( ) . initCause ( e ) ; if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "fromLogData" , se ) ; throw ( SystemException ) se ; } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "fromLogData" , wsatRC ) ; return wsatRC ; }
|
As called after recovery on distributed platform
| 254
| 7
|
160,138
|
private boolean handleAdditionalAnnotation ( List < Parameter > parameters , Annotation annotation , final Type type , Set < Type > typesToSkip , javax . ws . rs . Consumes classConsumes , javax . ws . rs . Consumes methodConsumes , Components components , boolean includeRequestBody ) { boolean processed = false ; if ( BeanParam . class . isAssignableFrom ( annotation . getClass ( ) ) ) { // Use Jackson's logic for processing Beans final BeanDescription beanDesc = mapper . getSerializationConfig ( ) . introspect ( constructType ( type ) ) ; final List < BeanPropertyDefinition > properties = beanDesc . findProperties ( ) ; for ( final BeanPropertyDefinition propDef : properties ) { final AnnotatedField field = propDef . getField ( ) ; final AnnotatedMethod setter = propDef . getSetter ( ) ; final AnnotatedMethod getter = propDef . getGetter ( ) ; final List < Annotation > paramAnnotations = new ArrayList < Annotation > ( ) ; final Iterator < OpenAPIExtension > extensions = OpenAPIExtensions . chain ( ) ; Type paramType = null ; // Gather the field's details if ( field != null ) { paramType = field . getType ( ) ; for ( final Annotation fieldAnnotation : field . annotations ( ) ) { if ( ! paramAnnotations . contains ( fieldAnnotation ) ) { paramAnnotations . add ( fieldAnnotation ) ; } } } // Gather the setter's details but only the ones we need if ( setter != null ) { // Do not set the param class/type from the setter if the values are already identified if ( paramType == null ) { // paramType will stay null if there is no parameter paramType = setter . getParameterType ( 0 ) ; } for ( final Annotation fieldAnnotation : setter . annotations ( ) ) { if ( ! paramAnnotations . contains ( fieldAnnotation ) ) { paramAnnotations . add ( fieldAnnotation ) ; } } } // Gather the getter's details but only the ones we need if ( getter != null ) { // Do not set the param class/type from the getter if the values are already identified if ( paramType == null ) { paramType = getter . getType ( ) ; } for ( final Annotation fieldAnnotation : getter . annotations ( ) ) { if ( ! paramAnnotations . contains ( fieldAnnotation ) ) { paramAnnotations . add ( fieldAnnotation ) ; } } } if ( paramType == null ) { continue ; } // Re-process all Bean fields and let the default swagger-jaxrs/swagger-jersey-jaxrs processors do their thing List < Parameter > extracted = extensions . next ( ) . extractParameters ( paramAnnotations , paramType , typesToSkip , components , classConsumes , methodConsumes , includeRequestBody , extensions ) . parameters ; for ( Parameter p : extracted ) { if ( ParameterProcessor . applyAnnotations ( p , paramType , paramAnnotations , components , classConsumes == null ? new String [ 0 ] : classConsumes . value ( ) , methodConsumes == null ? new String [ 0 ] : methodConsumes . value ( ) ) != null ) { parameters . add ( p ) ; } } processed = true ; } } return processed ; }
|
Adds additional annotation processing support
| 735
| 5
|
160,139
|
protected String replaceAllProperties ( String str , final Properties submittedProps , final Properties xmlProperties ) { int startIndex = 0 ; NextProperty nextProp = this . findNextProperty ( str , startIndex ) ; while ( nextProp != null ) { // get the start index past this property for the next property in // the string //startIndex = this.getEndIndexOfNextProperty(str, startIndex); startIndex = nextProp . endIndex ; // resolve the property String nextPropValue = this . resolvePropertyValue ( nextProp . propName , nextProp . propType , submittedProps , xmlProperties ) ; //if the property didn't resolve use the default value if it exists if ( nextPropValue . equals ( UNRESOLVED_PROP_VALUE ) ) { if ( nextProp . defaultValueExpression != null ) { nextPropValue = this . replaceAllProperties ( nextProp . defaultValueExpression , submittedProps , xmlProperties ) ; } } // After we get this value the lenght of the string might change so // we need to reset the start index int lengthDifference = 0 ; switch ( nextProp . propType ) { case JOB_PARAMETERS : lengthDifference = nextPropValue . length ( ) - ( nextProp . propName . length ( ) + "#{jobParameters['']}" . length ( ) ) ; // this can be a negative value startIndex = startIndex + lengthDifference ; // move start index for next property str = str . replace ( "#{jobParameters['" + nextProp . propName + "']}" + nextProp . getDefaultValExprWithDelimitersIfExists ( ) , nextPropValue ) ; break ; case JOB_PROPERTIES : lengthDifference = nextPropValue . length ( ) - ( nextProp . propName . length ( ) + "#{jobProperties['']}" . length ( ) ) ; // this can be a negative value startIndex = startIndex + lengthDifference ; // move start index for next property str = str . replace ( "#{jobProperties['" + nextProp . propName + "']}" + nextProp . getDefaultValExprWithDelimitersIfExists ( ) , nextPropValue ) ; break ; case SYSTEM_PROPERTIES : lengthDifference = nextPropValue . length ( ) - ( nextProp . propName . length ( ) + "#{systemProperties['']}" . length ( ) ) ; // this can be a negative value startIndex = startIndex + lengthDifference ; // move start index for next property str = str . replace ( "#{systemProperties['" + nextProp . propName + "']}" + nextProp . getDefaultValExprWithDelimitersIfExists ( ) , nextPropValue ) ; break ; case PARTITION_PROPERTIES : lengthDifference = nextPropValue . length ( ) - ( nextProp . propName . length ( ) + "#{partitionPlan['']}" . length ( ) ) ; // this can be a negative value startIndex = startIndex + lengthDifference ; // move start index for next property str = str . replace ( "#{partitionPlan['" + nextProp . propName + "']}" + nextProp . getDefaultValExprWithDelimitersIfExists ( ) , nextPropValue ) ; break ; } // find the next property nextProp = this . findNextProperty ( str , startIndex ) ; } return str ; }
|
Replace all the properties in String str .
| 758
| 9
|
160,140
|
private String resolvePropertyValue ( final String name , PROPERTY_TYPE propType , final Properties submittedProperties , final Properties xmlProperties ) { String value = null ; switch ( propType ) { case JOB_PARAMETERS : if ( submittedProperties != null ) { value = submittedProperties . getProperty ( name ) ; } if ( value != null ) { return value ; } break ; case JOB_PROPERTIES : if ( xmlProperties != null ) { value = xmlProperties . getProperty ( name ) ; } if ( value != null ) { return value ; } break ; case SYSTEM_PROPERTIES : value = System . getProperty ( name ) ; if ( value != null ) { return value ; } break ; case PARTITION_PROPERTIES : //We are reusing the submitted props to carry the partition props if ( submittedProperties != null ) { value = submittedProperties . getProperty ( name ) ; } if ( value != null ) { return value ; } break ; } return UNRESOLVED_PROP_VALUE ; }
|
Gets the value of a property using the property type
| 232
| 11
|
160,141
|
private Properties inheritProperties ( final Properties parentProps , final Properties childProps ) { if ( parentProps == null ) { return childProps ; } if ( childProps == null ) { return parentProps ; } for ( final String parentKey : parentProps . stringPropertyNames ( ) ) { // Add the parent property to the child if the child does not // already define it if ( ! childProps . containsKey ( parentKey ) ) { childProps . setProperty ( parentKey , parentProps . getProperty ( parentKey ) ) ; } } return childProps ; }
|
Merge the parent properties that are already set into the child properties . Child properties always override parent values .
| 129
| 21
|
160,142
|
public boolean isCommitted ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { // 306998.15 Tr . debug ( tc , "isCommitted: " + committed ) ; } return committed ; }
|
Returns whether the output has been committed or not .
| 56
| 10
|
160,143
|
public void write ( int c ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { // 306998.15 Tr . debug ( tc , "write --> " + c ) ; } if ( ! _hasWritten && obs != null ) { _hasWritten = true ; obs . alertFirstWrite ( ) ; } if ( limit > - 1 ) { if ( total >= limit ) { throw new WriteBeyondContentLengthException ( ) ; } } if ( count == buf . length ) { response . setFlushMode ( false ) ; flushChars ( ) ; response . setFlushMode ( true ) ; } buf [ count ++ ] = ( char ) c ; total ++ ; }
|
Writes a char . This method will block until the char is actually written .
| 158
| 16
|
160,144
|
protected void flushChars ( ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { // 306998.15 Tr . debug ( tc , "flushChars" ) ; } if ( ! committed ) { if ( ! _hasFlushed && obs != null ) { _hasFlushed = true ; obs . alertFirstFlush ( ) ; } } committed = true ; if ( count > 0 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "flushChars, Count = " + count ) ; } writeOut ( buf , 0 , count ) ; // out.flush(); moved to writeOut 277717 SVT:Mixed information shown on // the Admin Console WAS.webcontainer count = 0 ; } else { // PK22392 start if ( response . getFlushMode ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "flushChars, Count 0 still flush mode is true , forceful flush" ) ; } response . flushBufferedContent ( ) ; } // PK22392 END else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "flushChars, flush mode is false" ) ; } } } }
|
Flushes the writer chars .
| 311
| 6
|
160,145
|
private void addAddressToList ( String newAddress , boolean validateOnly ) { int start = 0 ; char delimiter = ' ' ; String sub ; int radix = 10 ; // Address initially set to all zeroes int addressToAdd [ ] = new int [ IP_ADDR_NUMBERS ] ; for ( int i = 0 ; i < IP_ADDR_NUMBERS ; i ++ ) { addressToAdd [ i ] = 0 ; } int slot = IP_ADDR_NUMBERS - 1 ; // assume the address is IP4, but change to IP6 if there is a colon if ( newAddress . indexOf ( ' ' ) == - 1 ) { // if no ".", then assume IPv6 Address delimiter = ' ' ; radix = 16 ; } String addr = newAddress ; while ( true ) { // fill address from back to front start = addr . lastIndexOf ( delimiter ) ; if ( start != - 1 ) { sub = addr . substring ( start + 1 ) ; if ( sub . trim ( ) . equals ( "*" ) ) { addressToAdd [ slot ] = - 1 ; // 0xFFFFFFFF is the wildcard. } else { addressToAdd [ slot ] = Integer . parseInt ( sub , radix ) ; } } else { if ( addr . trim ( ) . equals ( "*" ) ) { addressToAdd [ slot ] = - 1 ; // 0xFFFFFFFF is the wildcard. } else { addressToAdd [ slot ] = Integer . parseInt ( addr , radix ) ; } break ; } slot = slot - 1 ; addr = addr . substring ( 0 , start ) ; } if ( ! validateOnly ) { putInList ( addressToAdd ) ; } }
|
Add one IPv4 or IPv6 address to the tree . The address is passed in as a string and converted to an integer array by this routine . Another method is then called to put it into the tree
| 377
| 41
|
160,146
|
public boolean findInList ( byte [ ] address ) { int len = address . length ; int a [ ] = new int [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { // convert possible negative byte value to positive int a [ i ] = address [ i ] & 0x00FF ; } return findInList ( a ) ; }
|
Determine if an address represented by a byte array is in the address tree
| 79
| 16
|
160,147
|
public boolean findInList6 ( byte [ ] address ) { int len = address . length ; int a [ ] = new int [ len / 2 ] ; // IPv6, need to combine every two bytes to the ints int j = 0 ; int highOrder = 0 ; int lowOrder = 0 ; for ( int i = 0 ; i < len ; i += 2 ) { // convert possible negative byte value to positive int highOrder = address [ i ] & 0x00FF ; lowOrder = address [ i + 1 ] & 0x00FF ; a [ j ] = highOrder * 256 + lowOrder ; j ++ ; } return findInList ( a ) ; }
|
Determine if an IPv6 address represented by a byte array is in the address tree
| 143
| 18
|
160,148
|
public boolean findInList ( int [ ] address ) { int len = address . length ; if ( len < IP_ADDR_NUMBERS ) { int j = IP_ADDR_NUMBERS - 1 ; // for performace, hard code the size here int a [ ] = { 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ; // int a[] = new int[IP_ADDR_NUMBERS]; // for (int i = 0; i < IP_ADDR_NUMBERS; i++) // { // a[i] = 0; // } for ( int i = len ; i > 0 ; i -- , j -- ) { a [ j ] = address [ i - 1 ] ; } return findInList ( a , 0 , firstCell , 7 ) ; } return findInList ( address , 0 , firstCell , ( address . length - 1 ) ) ; }
|
Determine if an address represented by an integer array is in the address tree
| 199
| 16
|
160,149
|
private boolean findInList ( int [ ] address , int index , FilterCell cell , int endIndex ) { if ( cell . getWildcardCell ( ) != null ) { // first look at wildcard slot if ( index == endIndex ) { // at the end, so we found a match, unwind returning true return true ; } // go to next level of this tree path FilterCell newcell = cell . getWildcardCell ( ) ; // recursively search this path if ( findInList ( address , index + 1 , newcell , endIndex ) ) { return true ; } // the wildcard path didn't work, so see if there is a non-wildcard path FilterCell nextCell = cell . findNextCell ( address [ index ] ) ; if ( nextCell != null ) { // see if we are at the end of a valid path if ( index == endIndex ) { // this path found a match, unwind returning true return true ; } // ok so far, recursively search this path return findInList ( address , index + 1 , nextCell , endIndex ) ; } // this path did not find a match. return false ; } // no wildcard here, try the non-wildcard path FilterCell nextCell = cell . findNextCell ( address [ index ] ) ; if ( nextCell != null ) { if ( index == endIndex ) { // this path found a match, unwind returning true return true ; } // ok so far, recursively search this path return findInList ( address , index + 1 , nextCell , endIndex ) ; } // this path did not find a match. return false ; }
|
Determine recursively if an address represented by an integer array is in the address tree
| 352
| 19
|
160,150
|
public boolean isInstrumentableMethod ( int access , String methodName , String descriptor ) { if ( ( access & Opcodes . ACC_SYNTHETIC ) != 0 ) { return false ; } if ( ( access & Opcodes . ACC_NATIVE ) != 0 ) { return false ; } if ( ( access & Opcodes . ACC_ABSTRACT ) != 0 ) { return false ; } if ( methodName . equals ( "toString" ) && descriptor . equals ( "()Ljava/lang/String;" ) ) { return false ; } if ( methodName . equals ( "hashCode" ) && descriptor . equals ( "()I" ) ) { return false ; } return true ; }
|
Indicate whether or not the target method is instrumentable .
| 151
| 12
|
160,151
|
@ Mode ( TestMode . LITE ) @ Test public void MPJwtBadMPConfigAsSystemProperties_GoodMpJwtConfigSpecifiedInServerXml ( ) throws Exception { resourceServer . reconfigureServerUsingExpandedConfiguration ( _testName , "rs_server_AltConfigNotInApp_goodServerXmlConfig.xml" ) ; standardTestFlow ( resourceServer , MpJwtFatConstants . NO_MP_CONFIG_IN_APP_ROOT_CONTEXT , MpJwtFatConstants . NO_MP_CONFIG_IN_APP_APP , MpJwtFatConstants . MPJWT_APP_CLASS_NO_MP_CONFIG_IN_APP ) ; }
|
The server will be started with all mp - config properties incorrectly configured in the jvm . options file . The server . xml has a valid mp_jwt config specified . The config settings should come from server . xml . The test should run successfully .
| 158
| 51
|
160,152
|
@ Override @ FFDCIgnore ( JobExecutionNotRunningException . class ) public void stop ( ) { StopLock stopLock = getStopLock ( ) ; // Store in local variable to facilitate Ctrl+Shift+G search in Eclipse synchronized ( stopLock ) { if ( isStepStartingOrStarted ( ) ) { updateStepBatchStatus ( BatchStatus . STOPPING ) ; // It's possible we may try to stop a partitioned step before any // sub steps have been started. // Note: in multi-jvm mode parallelBatchWorkUnits will be empty (sub-jobs may not be // running locally, so no easy way to stop them). // TODO: could queue stopPartition thru JMS i suppose...). for ( BatchPartitionWorkUnit subJob : parallelBatchWorkUnits ) { try { getBatchKernelService ( ) . stopWorkUnit ( subJob ) ; } catch ( JobExecutionNotRunningException e ) { logger . fine ( "Caught exception trying to stop work unit: " + subJob + ", which was not running." ) ; // We want to stop all running sub steps. // We do not want to throw an exception if a sub step has already been completed. } catch ( Exception e ) { // Blow up if it happens to force the issue. throw new IllegalStateException ( e ) ; } } } else { // Might not be set up yet to have a state. logger . fine ( "Ignoring stop, since step not in a state which has a valid status (might not be far enough along to have a state yet)" ) ; } } }
|
The body of this method is synchronized with startPartition to close timing windows so that a new partition doesn t get started after this method has gone thru and stopped all currently running partitions .
| 345
| 37
|
160,153
|
private void setExecutionTypeIfNotSet ( ExecutionType executionType ) { if ( this . executionType == null ) { logger . finer ( "Setting initial execution type value" ) ; this . executionType = executionType ; } else { logger . finer ( "Not setting execution type value since it's already set" ) ; } }
|
We could be more aggressive about validating illegal states and throwing exceptions here .
| 70
| 15
|
160,154
|
private void validatePlanNumberOfPartitions ( PartitionPlanDescriptor currentPlan ) { int numPreviousPartitions = getTopLevelStepInstance ( ) . getPartitionPlanSize ( ) ; int numCurrentPartitions = currentPlan . getNumPartitionsInPlan ( ) ; if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "For step: " + getStepName ( ) + ", previous num partitions = " + numPreviousPartitions + ", and current num partitions = " + numCurrentPartitions ) ; } if ( executionType == ExecutionType . RESTART_NORMAL ) { if ( numPreviousPartitions == EntityConstants . PARTITION_PLAN_SIZE_UNINITIALIZED ) { logger . fine ( "For step: " + getStepName ( ) + ", previous num partitions has not been initialized, so don't validate the current plan size against it" ) ; } else if ( numCurrentPartitions != numPreviousPartitions ) { throw new IllegalArgumentException ( "Partition not configured for override, and previous execution used " + numPreviousPartitions + " number of partitions, while current plan uses a different number: " + numCurrentPartitions ) ; } } if ( numCurrentPartitions < 1 ) { throw new IllegalArgumentException ( "Partition plan size is calculated as " + numCurrentPartitions + ", but at least one partition is needed." ) ; } }
|
Verify the number of partitions in the plan makes sense .
| 307
| 12
|
160,155
|
private boolean isStoppingStoppedOrFailed ( ) { BatchStatus jobBatchStatus = runtimeWorkUnitExecution . getBatchStatus ( ) ; if ( jobBatchStatus . equals ( BatchStatus . STOPPING ) || jobBatchStatus . equals ( BatchStatus . STOPPED ) || jobBatchStatus . equals ( BatchStatus . FAILED ) ) { return true ; } return false ; }
|
Today we know the PartitionedStepControllerImpl always runs in the JVM of the top - level job and so will be notified on the top - level stop .
| 93
| 34
|
160,156
|
private void partitionFinished ( PartitionReplyMsg msg ) { JoblogUtil . logToJobLogAndTraceOnly ( Level . FINE , "partition.ended" , new Object [ ] { msg . getPartitionPlanConfig ( ) . getPartitionNumber ( ) , msg . getBatchStatus ( ) , msg . getExitStatus ( ) , msg . getPartitionPlanConfig ( ) . getStepName ( ) , msg . getPartitionPlanConfig ( ) . getTopLevelNameInstanceExecutionInfo ( ) . getInstanceId ( ) , msg . getPartitionPlanConfig ( ) . getTopLevelNameInstanceExecutionInfo ( ) . getExecutionId ( ) } , logger ) ; finishedWork . add ( msg ) ; }
|
Issue message for partition finished and add it to the finishedWork list .
| 162
| 14
|
160,157
|
private void waitForNextPartitionToFinish ( List < Throwable > analyzerExceptions , List < Integer > finishedPartitions ) throws JobStoppingException { //Use this counter to count the number of cycles we recieve jms reply message boolean isStoppingStoppedOrFailed = false ; PartitionReplyMsg msg = null ; do { //TODO - We won't worry about local dispatch until we're prepated to code up // the structure necessary to break free from waiting on the BlockingQueue if ( isMultiJvm ) { if ( isStoppingStoppedOrFailed ( ) ) { isStoppingStoppedOrFailed = true ; } } //This will only be triggered when stop issued if ( isStoppingStoppedOrFailed ) { //TODO - Crude, and the JVM doesn't have to follow this too closely. // The idea is to give the partitions some time complete so we can report with // a more tidy final status. // Another idea would be to start a timer or do the first wait with a receive. // try { Thread . sleep ( PartitionReplyTimeoutConstants . BATCH_REPLY_MSG_SLEEP_AFTER_STOP ) ; } catch ( InterruptedException e ) { // do nothing } while ( true ) { //Get the message from the replyToQueue msg = waitForPartitionReplyMsgNoWait ( ) ; //If no messages left, break the loop if ( msg != null ) { try { processPartitionReplyMsg ( msg ) ; } catch ( Throwable t ) { // FFDC. // Remember the exception for rollback later. analyzerExceptions . add ( t ) ; } //check if last message received, and process it. receivedLastMessageForPartition ( msg , finishedPartitions ) ; } else { throw new JobStoppingException ( ) ; } } } else { //This is executed when stop has not been issued msg = waitForPartitionReplyMsg ( ) ; //If waitForPartitionReplyMsg times out after 15 seconds, go back to the top and check //if stop has been issued or not if ( msg == null ) { continue ; } } //This should never be executed while msg == null cause it the loop would have been broken or continued try { processPartitionReplyMsg ( msg ) ; } catch ( Throwable t ) { // FFDC. // Remember the exception for rollback later. analyzerExceptions . add ( t ) ; } } while ( msg == null || ! receivedLastMessageForPartition ( msg , finishedPartitions ) ) ; }
|
Wait and process the data sent back by the partitions . This method returns as soon as the next partition sends back an i m finished message .
| 549
| 28
|
160,158
|
@ FFDCIgnore ( JobStoppingException . class ) private void executeAndWaitForCompletion ( PartitionPlanDescriptor currentPlan ) throws JobRestartException { if ( isStoppingStoppedOrFailed ( ) ) { logger . fine ( "Job already in " + runtimeWorkUnitExecution . getWorkUnitJobContext ( ) . getBatchStatus ( ) . toString ( ) + " state, exiting from executeAndWaitForCompletion() before beginning execution" ) ; return ; } List < Integer > partitionsToExecute = getPartitionNumbersToExecute ( currentPlan ) ; logger . fine ( "Partitions to execute in this run: " + partitionsToExecute + ". Total number of partitions in step: " + currentPlan . getNumPartitionsInPlan ( ) ) ; List < Integer > startedPartitions = new ArrayList < Integer > ( ) ; List < Integer > finishedPartitions = new ArrayList < Integer > ( ) ; List < Throwable > analyzerExceptions = new ArrayList < Throwable > ( ) ; // Keep looping until all partitions have finished. while ( finishedPartitions . size ( ) < partitionsToExecute . size ( ) ) { startPartitions ( partitionsToExecute , startedPartitions , finishedPartitions , currentPlan ) ; // Check that there are still un-finished partitions running. // If not, break out of the loop. if ( finishedPartitions . size ( ) >= partitionsToExecute . size ( ) ) { break ; } //Break this loop when nextPartitionFinished is -1 try { waitForNextPartitionToFinish ( analyzerExceptions , finishedPartitions ) ; } catch ( JobStoppingException e ) { // break the loop break ; } } if ( ! analyzerExceptions . isEmpty ( ) ) { rollbackPartitionedStep ( ) ; throw new BatchContainerRuntimeException ( "Exception previously thrown by Analyzer, rolling back step." , analyzerExceptions . get ( 0 ) ) ; } }
|
Spawn the partitions and wait for them to complete .
| 430
| 10
|
160,159
|
private void checkFinishedPartitions ( ) { List < String > failingPartitionSeen = new ArrayList < String > ( ) ; boolean stoppedPartitionSeen = false ; for ( PartitionReplyMsg replyMsg : finishedWork ) { BatchStatus batchStatus = replyMsg . getBatchStatus ( ) ; if ( logger . isLoggable ( Level . FINE ) ) { logger . fine ( "For partitioned step: " + getStepName ( ) + ", the partition # " + replyMsg . getPartitionPlanConfig ( ) . getPartitionNumber ( ) + " ended with status '" + batchStatus ) ; } // Keep looping, just to see the log messages perhaps. if ( batchStatus . equals ( BatchStatus . FAILED ) ) { String msg = "For partitioned step: " + getStepName ( ) + ", the partition # " + replyMsg . getPartitionPlanConfig ( ) . getPartitionNumber ( ) + " ended with status '" + batchStatus ; failingPartitionSeen . add ( msg ) ; } // This code seems to suggest it might be valid for a partition to end up in STOPPED state without // the "top-level" step having been aware of this. It's unclear from the spec if this is even possible // or a desirable spec interpretation. Nevertheless, we'll code it as such noting the ambiguity. // // However, in the RI at least, we won't bother updating the step level BatchStatus, since to date we // would only transition the status in such a way independently. if ( batchStatus . equals ( BatchStatus . STOPPED ) ) { stoppedPartitionSeen = true ; } } if ( ! failingPartitionSeen . isEmpty ( ) ) { markStepForFailure ( ) ; rollbackPartitionedStep ( ) ; throw new BatchContainerRuntimeException ( "One or more partitions failed: " + failingPartitionSeen ) ; } else if ( isStoppingStoppedOrFailed ( ) ) { rollbackPartitionedStep ( ) ; } else if ( stoppedPartitionSeen ) { // At this point, the top-level job is still running. // If we see a stopped partition, we mark the step/job failed markStepForFailure ( ) ; rollbackPartitionedStep ( ) ; } else { // Call before completion if ( this . partitionReducerProxy != null ) { this . partitionReducerProxy . beforePartitionedStepCompletion ( ) ; } } }
|
check the batch status of each subJob after it s done to see if we need to issue a rollback start rollback if any have stopped or failed
| 536
| 31
|
160,160
|
@ Override protected void invokePreStepArtifacts ( ) { if ( stepListeners != null ) { for ( StepListenerProxy listenerProxy : stepListeners ) { // Call beforeStep on all the step listeners listenerProxy . beforeStep ( ) ; } } // Invoke the reducer before all parallel steps start (must occur // before mapper as well) if ( this . partitionReducerProxy != null ) { this . partitionReducerProxy . beginPartitionedStep ( ) ; } }
|
Invoke the StepListeners and PartitionReducer .
| 104
| 12
|
160,161
|
private static String getClassNameandPath ( String className , Path path ) { if ( path == null ) { return getClassNameandPath ( className , "/" ) ; } else { return getClassNameandPath ( className , path . value ( ) ) ; } }
|
start Liberty change
| 60
| 3
|
160,162
|
private static boolean checkMethodDispatcher ( ClassResourceInfo cr ) { if ( cr . getMethodDispatcher ( ) . getOperationResourceInfos ( ) . isEmpty ( ) ) { LOG . warning ( new org . apache . cxf . common . i18n . Message ( "NO_RESOURCE_OP_EXC" , BUNDLE , cr . getServiceClass ( ) . getName ( ) ) . toString ( ) ) ; return false ; } return true ; }
|
end Liberty change
| 107
| 3
|
160,163
|
public void run ( ) { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . entry ( tc , "run" ) ; int numPools ; synchronized ( this ) { if ( ivIsCanceled ) { return ; } ivIsRunning = true ; numPools = pools . size ( ) ; if ( numPools > 0 ) { if ( numPools > poolArray . length ) { poolArray = new PoolImplBase [ numPools ] ; } pools . toArray ( poolArray ) ; } } try { for ( int i = 0 ; i < poolArray . length && poolArray [ i ] != null ; ++ i ) // 147140 { if ( poolArray [ i ] . inactive ) { poolArray [ i ] . periodicDrain ( ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setting inactive: " + poolArray [ i ] ) ; poolArray [ i ] . inactive = true ; } // Allow pools to be GC'ed promptly after being removed. PM54417 poolArray [ i ] = null ; } } finally { synchronized ( this ) { ivIsRunning = false ; if ( ivIsCanceled ) { notify ( ) ; } else if ( ! pools . isEmpty ( ) ) { startAlarm ( ) ; } else { ivScheduledFuture = null ; } } } if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . exit ( tc , "run" ) ; }
|
Handle the scavenger alarm . Scan the list of pools and drain all inactive ones .
| 354
| 17
|
160,164
|
private Object addBatch ( Object implObject , Method method , Object [ ] args ) throws IllegalAccessException , IllegalArgumentException , InvocationTargetException , SQLException { Object sqljPstmt = args [ 0 ] ; final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "addBatch" , new Object [ ] { this , AdapterUtil . toString ( sqljPstmt ) } ) ; // Get underlying instance of SQLJPreparedStatement from dynamic proxy // to avoid java.lang.ClassCastException in addBatch() if ( sqljPstmt != null && Proxy . isProxyClass ( sqljPstmt . getClass ( ) ) ) { InvocationHandler handler = Proxy . getInvocationHandler ( sqljPstmt ) ; if ( handler instanceof WSJdbcWrapper ) args = new Object [ ] { ( ( WSJdbcWrapper ) handler ) . getJDBCImplObject ( ) } ; } return method . invoke ( implObject , args ) ; }
|
Invokes addBatch after replacing the parameter with the DB2 impl object if proxied .
| 247
| 19
|
160,165
|
private Object executeBatch ( Object implObject , Method method , Object [ ] args ) throws IllegalAccessException , IllegalArgumentException , InvocationTargetException , SQLException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "executeBatch" , new Object [ ] { this , args [ 0 ] } ) ; if ( childWrapper != null ) { closeAndRemoveResultSet ( ) ; } if ( childWrappers != null && ! childWrappers . isEmpty ( ) ) { closeAndRemoveResultSets ( ) ; } enforceStatementProperties ( ) ; Object results = method . invoke ( implObject , args ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "executeBatch" , results instanceof int [ ] ? Arrays . toString ( ( int [ ] ) results ) : results ) ; return results ; }
|
Invokes executeBatch and after closing any previous result sets and ensuring statement properties are up - to - date .
| 219
| 23
|
160,166
|
private Object getReturnResultSet ( Object implObject , Method method ) throws IllegalAccessException , IllegalArgumentException , InvocationTargetException , SQLException { final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( trace && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getReturnResultSet" , this ) ; WSJdbcResultSet rsetWrapper = null ; ResultSet rsetImpl = ( ResultSet ) method . invoke ( implObject ) ; if ( rsetImpl != null ) { // If the childWrapper is null, and the childWrappers is null or // empty, set the result set to childWrapper; // Otherwise, add the result set to childWrappers if ( childWrapper == null && ( childWrappers == null || childWrappers . isEmpty ( ) ) ) { childWrapper = rsetWrapper = mcf . jdbcRuntime . newResultSet ( rsetImpl , this ) ; if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Set the result set to child wrapper" ) ; } else { if ( childWrappers == null ) childWrappers = new ArrayList < Wrapper > ( 5 ) ; rsetWrapper = mcf . jdbcRuntime . newResultSet ( rsetImpl , this ) ; childWrappers . add ( rsetWrapper ) ; if ( trace && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Add the result set to child wrappers list." ) ; } } if ( trace && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getReturnResultSet" , rsetWrapper ) ; return rsetWrapper ; }
|
Invokes getReturnResultSet and wraps the result set .
| 373
| 12
|
160,167
|
public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { if ( ! haveStatementPropertiesChanged && VENDOR_PROPERTY_SETTERS . contains ( method . getName ( ) ) ) { haveStatementPropertiesChanged = true ; } // The SQLJ programming model indicates that getSection should be callable on a // closed PreparedStatement. Therefore we manually cache the section and return it if ( sqljSection != null && "getSection" . equals ( method . getName ( ) ) ) { return sqljSection ; } return super . invoke ( proxy , method , args ) ; }
|
Intercept the proxy handler to detect changes to statement properties that must be reset on cached statements .
| 134
| 19
|
160,168
|
public void nextRangeMaximumAvailable ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "nextRangeMaximumAvailable" ) ; synchronized ( _globalUniqueLock ) { _globalUniqueThreshold = _globalUniqueLimit + _midrange ; _globalUniqueLimit = _globalUniqueLimit + _range ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "nextRangeMaximumAvailable" ) ; }
|
Callback to inform the generator that the current range of available unique keys has now grown .
| 121
| 17
|
160,169
|
public byte [ ] transform ( ClassLoader loader , String className , Class < ? > classBeingRedefined , ProtectionDomain protectionDomain , byte [ ] classfileBuffer ) throws IllegalClassFormatException { // Don't modify our own package if ( className . startsWith ( Transformer . class . getPackage ( ) . getName ( ) . replaceAll ( "\\." , "/" ) ) ) { return null ; } // Don't modify the java.util.logging classes if ( className . startsWith ( "java/util/logging/" ) ) { return null ; } boolean include = false ; for ( String s : includesList ) { if ( className . startsWith ( s ) || s . equals ( "/" ) ) { include = true ; break ; } } for ( String s : excludesList ) { if ( className . startsWith ( s ) || s . equals ( "/" ) ) { include = false ; break ; } } if ( include == false ) { return null ; } String internalPackageName = className . replaceAll ( "/[^/]+$" , "" ) ; PackageInfo packageInfo = getPackageInfo ( internalPackageName ) ; if ( packageInfo == null && loader != null ) { String packageInfoResourceName = internalPackageName + "/package-info.class" ; InputStream is = loader . getResourceAsStream ( packageInfoResourceName ) ; packageInfo = processPackageInfo ( is ) ; addPackageInfo ( packageInfo ) ; } try { return transform ( new ByteArrayInputStream ( classfileBuffer ) ) ; } catch ( Throwable t ) { t . printStackTrace ( ) ; return null ; } }
|
Instrument the classes .
| 354
| 5
|
160,170
|
public String resolveString ( String value , boolean ignoreWarnings ) throws ConfigEvaluatorException { value = variableEvaluator . resolveVariables ( value , this , ignoreWarnings ) ; return value ; }
|
Tries to resolve variables .
| 48
| 6
|
160,171
|
@ SuppressWarnings ( "unchecked" ) public void init ( ) throws ServletException { // Method re-written for PQ47469 String servlets = getRequiredInitParameter ( PARAM_SERVLET_PATHS ) ; StringTokenizer sTokenizer = new StringTokenizer ( servlets ) ; Vector servletChainPath = new Vector ( ) ; while ( sTokenizer . hasMoreTokens ( ) == true ) { String path = sTokenizer . nextToken ( ) . trim ( ) ; if ( path . length ( ) > 0 ) { servletChainPath . addElement ( path ) ; } } int chainLength = servletChainPath . size ( ) ; if ( chainLength > 0 ) { this . chainPath = new String [ chainLength ] ; for ( int index = 0 ; index < chainLength ; ++ index ) { this . chainPath [ index ] = ( String ) servletChainPath . elementAt ( index ) ; } } }
|
Initialize the servlet chainer .
| 209
| 8
|
160,172
|
public void service ( HttpServletRequest request , HttpServletResponse response ) throws ServletException , IOException { // Method re-written for PQ47469 ServletChain chain = new ServletChain ( ) ; try { String path = null ; for ( int index = 0 ; index < this . chainPath . length ; ++ index ) { path = this . chainPath [ index ] ; RequestDispatcher rDispatcher = getServletContext ( ) . getRequestDispatcher ( path ) ; chain . addRequestDispatcher ( rDispatcher ) ; } chain . forward ( new HttpServletRequestWrapper ( request ) , new HttpServletResponseWrapper ( response ) ) ; } finally { if ( chain != null ) { chain . clear ( ) ; } } }
|
Handle a servlet request by chaining the configured list of servlets . Only the final response in the chain will be sent back to the client . This servlet does not actual generate any content . This servlet only constructs and processes the servlet chain .
| 173
| 52
|
160,173
|
String getRequiredInitParameter ( String name ) throws ServletException { String value = getInitParameter ( name ) ; if ( value == null ) { throw new ServletException ( MessageFormat . format ( nls . getString ( "Missing.required.initialization.parameter" , "Missing required initialization parameter: {0}" ) , new Object [ ] { name } ) ) ; } return value ; }
|
Retrieve a required init parameter by name .
| 86
| 9
|
160,174
|
private void initializePermissions ( ) { // Set the default restrictable permissions int count = 0 ; if ( tc . isDebugEnabled ( ) ) { if ( isServer ) { Tr . debug ( tc , "running on server " ) ; } else { Tr . debug ( tc , "running on client " ) ; } } if ( isServer ) { count = DEFAULT_SERVER_RESTRICTABLE_PERMISSIONS . length ; originationFile = SERVER_XML ; } else { count = DEFAULT_CLIENT_RESTRICTABLE_PERMISSIONS . length ; originationFile = CLIENT_XML ; } for ( int i = 0 ; i < count ; i ++ ) { if ( isServer ) { restrictablePermissions . add ( DEFAULT_SERVER_RESTRICTABLE_PERMISSIONS [ i ] ) ; } else { restrictablePermissions . add ( DEFAULT_CLIENT_RESTRICTABLE_PERMISSIONS [ i ] ) ; } } // Iterate through the configured Permissions. if ( permissions != null && ! permissions . isEmpty ( ) ) { Iterable < JavaPermissionsConfiguration > javaPermissions = permissions . services ( ) ; if ( javaPermissions != null ) { for ( JavaPermissionsConfiguration permission : javaPermissions ) { String permissionClass = String . valueOf ( permission . get ( JavaPermissionsConfiguration . PERMISSION ) ) ; String target = String . valueOf ( permission . get ( JavaPermissionsConfiguration . TARGET_NAME ) ) ; String action = String . valueOf ( permission . get ( JavaPermissionsConfiguration . ACTIONS ) ) ; String credential = String . valueOf ( permission . get ( JavaPermissionsConfiguration . SIGNED_BY ) ) ; String principalType = String . valueOf ( permission . get ( JavaPermissionsConfiguration . PRINCIPAL_TYPE ) ) ; String principalName = String . valueOf ( permission . get ( JavaPermissionsConfiguration . PRINCIPAL_NAME ) ) ; String codebase = normalize ( String . valueOf ( permission . get ( JavaPermissionsConfiguration . CODE_BASE ) ) ) ; // Create the permission object Permission perm = createPermissionObject ( permissionClass , target , action , credential , principalType , principalName , originationFile ) ; boolean isRestriction = false ; // Is this a restriciton or a grant? if ( permission . get ( JavaPermissionsConfiguration . RESTRICTION ) != null ) { isRestriction = ( ( Boolean ) permission . get ( JavaPermissionsConfiguration . RESTRICTION ) ) . booleanValue ( ) ; } if ( isRestriction ) { // If this is a restriction if ( perm != null ) { restrictablePermissions . add ( perm ) ; } } else { // If this is not a restriction, then set is a grant if ( perm != null ) { // if codebase is present, then set the permission on the shared lib classloader if ( codebase != null && ! codebase . equalsIgnoreCase ( "null" ) ) { setCodeBasePermission ( codebase , perm ) ; } else { grantedPermissions . add ( perm ) ; } } } } if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "restrictablePermissions : " + restrictablePermissions ) ; Tr . debug ( tc , "grantedPermissions : " + grantedPermissions ) ; } } } setSharedLibraryPermission ( ) ; }
|
InvocationTargetException . class NoSuchMethodException . class SecurityException . class } )
| 744
| 18
|
160,175
|
@ Override public PermissionCollection getCombinedPermissions ( PermissionCollection staticPolicyPermissionCollection , CodeSource codesource ) { Permissions effectivePermissions = new Permissions ( ) ; List < Permission > staticPolicyPermissions = Collections . list ( staticPolicyPermissionCollection . elements ( ) ) ; String codeBase = codesource . getLocation ( ) . getPath ( ) ; // TODO: This should be using the CodeSource itself to compare with existing code sources ArrayList < Permission > permissions = getEffectivePermissions ( staticPolicyPermissions , codeBase ) ; for ( Permission permission : permissions ) { effectivePermissions . add ( permission ) ; } return effectivePermissions ; }
|
Combine the static permissions with the server . xml and permissions . xml permissions removing any restricted permission . This is called back from the dynamic policy to obtain the permissions for the JSP classes .
| 147
| 38
|
160,176
|
private boolean isRestricted ( Permission permission ) { for ( Permission restrictedPermission : restrictablePermissions ) { if ( restrictedPermission . implies ( permission ) ) { return true ; } } return false ; }
|
Check if this is a restricted permission .
| 46
| 8
|
160,177
|
public void addPermissionsXMLPermission ( CodeSource codeSource , Permission permission ) { ArrayList < Permission > permissions = null ; String codeBase = codeSource . getLocation ( ) . getPath ( ) ; if ( ! isRestricted ( permission ) ) { if ( permissionXMLPermissionMap . containsKey ( codeBase ) ) { permissions = permissionXMLPermissionMap . get ( codeBase ) ; permissions . add ( permission ) ; } else { permissions = new ArrayList < Permission > ( ) ; permissions . add ( permission ) ; permissionXMLPermissionMap . put ( codeBase , permissions ) ; } } }
|
Adds a permission from the permissions . xml file for the given CodeSource .
| 137
| 15
|
160,178
|
public NonDelayedClassInfo getClassInfo ( ) { String useName = getName ( ) ; NonDelayedClassInfo useClassInfo = this . classInfo ; if ( useClassInfo != null ) { if ( ! useClassInfo . isJavaClass ( ) && ! ( useClassInfo . isAnnotationPresent ( ) || useClassInfo . isFieldAnnotationPresent ( ) || useClassInfo . isMethodAnnotationPresent ( ) ) ) { getInfoStore ( ) . recordAccess ( useClassInfo ) ; } return useClassInfo ; } useClassInfo = getInfoStore ( ) . resolveClassInfo ( useName ) ; String [ ] useLogParms = getLogParms ( ) ; if ( useLogParms != null ) { useLogParms [ EXTRA_DATA_OFFSET_0 ] = useName ; } if ( useClassInfo == null ) { // defect 84235: If an error caused this, the warning was reported at a lower level. Since this is // going to be 'handled', we should not generate another warning message. //Tr.warning(tc, "ANNO_CLASSINFO_CLASS_NOTFOUND", getHashText(), useName); // CWWKC0025W if ( useLogParms != null ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] - Class not found [ {1} ]" , ( Object [ ] ) useLogParms ) ) ; } useClassInfo = new NonDelayedClassInfo ( useName , getInfoStore ( ) ) ; this . isArtificial = true ; // START: TFB: Defect 59284: More required updates: // // The newly created class info was not properly added as a class info, // leading to an NPE in the cache list management (in ClassInfoCache.makeFirst). getInfoStore ( ) . getClassInfoCache ( ) . addClassInfo ( useClassInfo ) ; // END: TFB: Defect 59284: More required updates: } // START: TFB: Defect 59284: Don't throw an exception for a failed load. // // Tracing enablement for defect 59284 showed an error of the sequence // of assigning the result class info hash text into the logging parameters. // // Prior to the assignment steps, 'this.classInfo' is null. // // A NullPointerException results, respective only of trace enablement // and irrespective of the d59284 changes. // // Move the logging code to after the 'this.classInfo' assignment. // if (useLogParms != null) { // useLogParms[EXTRA_DATA_OFFSET_1] = this.classInfo.getHashText(); // } useClassInfo . setDelayedClassInfo ( this ) ; this . classInfo = useClassInfo ; if ( useLogParms != null ) { useLogParms [ EXTRA_DATA_OFFSET_1 ] = this . classInfo . getHashText ( ) ; // D59284 if ( this . isArtificial ) { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] RETURN [ {1} ] as [ {2} ] ** ARTFICIAL **" , ( Object [ ] ) useLogParms ) ) ; } else { Tr . debug ( tc , MessageFormat . format ( "[ {0} ] RETURN [ {1} ] as [ {2} ] " , ( Object [ ] ) useLogParms ) ) ; } } // END: TFB: Defect 59284: Don't throw an exception for a failed load. return useClassInfo ; }
|
Assignments to the extra data of the log parms may not be held across other method calls .
| 774
| 21
|
160,179
|
protected void intialiseNonPersistent ( MultiMEProxyHandler proxyHandler , Neighbours neighbours ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "intialiseNonPersistent" ) ; iProxyHandler = proxyHandler ; iNeighbours = neighbours ; iDestinationManager = iProxyHandler . getMessageProcessor ( ) . getDestinationManager ( ) ; iRemoteQueue = SIMPUtils . createJsSystemDestinationAddress ( SIMPConstants . PROXY_SYSTEM_DESTINATION_PREFIX , iMEUuid , iBusId ) ; if ( iMEUuid == null ) iMEUuid = iRemoteQueue . getME ( ) ; iProxies = new Hashtable ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "intialiseNonPersistent" ) ; }
|
Setup the non persistent state .
| 218
| 6
|
160,180
|
public final SIBUuid8 getUUID ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getUUID" ) ; SibTr . exit ( tc , "getUUID" , iMEUuid ) ; } return iMEUuid ; }
|
Gets the UUID for this Neighbour
| 78
| 9
|
160,181
|
public final String getBusId ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getBusId" ) ; SibTr . exit ( tc , "getBusId" , iBusId ) ; } return iBusId ; }
|
Get the Bus name for this Neighbour
| 72
| 8
|
160,182
|
BusGroup getBus ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getBus" ) ; SibTr . exit ( tc , "getBus" , iBusGroup ) ; } return iBusGroup ; }
|
Gets the Bus for this Neighbour
| 68
| 8
|
160,183
|
void setBus ( BusGroup busGroup ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setBus" ) ; iBusGroup = busGroup ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setBus" ) ; }
|
Sets the Bus for this Neighbour
| 88
| 8
|
160,184
|
private synchronized void createProducerSession ( ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createProducerSession" ) ; if ( iProducerSession == null ) { try { iProducerSession = ( ProducerSessionImpl ) iProxyHandler . getMessageProcessor ( ) . getSystemConnection ( ) . createSystemProducerSession ( iRemoteQueue , null , null , null , null ) ; } catch ( SIException e ) { // No exceptions should occur as the destination should always exists // as it is created at start time. FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.proxyhandler.Neighbour.createProducerSession" , "1:434:1.107" , this ) ; SibTr . exception ( tc , e ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createProducerSession" , "SIResourceException" ) ; // this is already NLS'd //175907 throw new SIResourceException ( e ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "createProducerSession" ) ; }
|
Creates a producer session for sending the proxy messages to the Neighbours
| 304
| 15
|
160,185
|
protected void removeSubscription ( SIBUuid12 topicSpace , String topic ) { // Generate a key for the topicSpace/topic final String key = BusGroup . subscriptionKey ( topicSpace , topic ) ; iProxies . remove ( key ) ; }
|
Remove the subscription in the case of a rollback
| 56
| 10
|
160,186
|
MESubscription proxyDeregistered ( SIBUuid12 topicSpace , String topic , Transaction transaction ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "proxyDeregistered" , new Object [ ] { topicSpace , topic , transaction } ) ; // Generate a key for the topicSpace/topic final String key = BusGroup . subscriptionKey ( topicSpace , topic ) ; // Get the subscrition from the Hashtable. final MESubscription sub = ( MESubscription ) iProxies . get ( key ) ; if ( sub != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Subscription " + sub + " being removed" ) ; // Remove the subscription from the Neighbour item Stream. try { sub . remove ( transaction , sub . getLockID ( ) ) ; } catch ( MessageStoreException e ) { FFDCFilter . processException ( e , "com.ibm.ws.sib.processor.proxyhandler.Neighbour.proxyDeregistered" , "1:669:1.107" , this ) ; SibTr . exception ( tc , e ) ; SibTr . error ( tc , "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour" , "1:676:1.107" , e } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "proxyDeregistered" , "SIResourceException" ) ; throw new SIResourceException ( nls . getFormattedMessage ( "INTERNAL_MESSAGING_ERROR_CWSIP0002" , new Object [ ] { "com.ibm.ws.sib.processor.proxyhandler.Neighbour" , "1:686:1.107" , e } , null ) , e ) ; } // Remove the proxy from the list iProxies . remove ( key ) ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "No Subscription to be removed" ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "proxyDeregistered" , sub ) ; return sub ; }
|
proxyDeregistered is called on this Neighbour object when a delete proxy subscription is received from a Neighbour .
| 583
| 24
|
160,187
|
protected void addSubscription ( SIBUuid12 topicSpace , String topic , MESubscription subscription ) { // Generate a key for the topicSpace/topic final String key = BusGroup . subscriptionKey ( topicSpace , topic ) ; iProxies . put ( key , subscription ) ; }
|
Adds the rolled back subscription to the list .
| 64
| 9
|
160,188
|
protected MESubscription getSubscription ( SIBUuid12 topicSpace , String topic ) { return ( MESubscription ) iProxies . get ( BusGroup . subscriptionKey ( topicSpace , topic ) ) ; }
|
Gets the MESubscription represented from this topicSpace and topic
| 49
| 14
|
160,189
|
void markAllProxies ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "markAllProxies" ) ; final Enumeration enu = iProxies . elements ( ) ; // Cycle through each of the proxies while ( enu . hasMoreElements ( ) ) { final MESubscription sub = ( MESubscription ) enu . nextElement ( ) ; // Mark the subscription. sub . mark ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "markAllProxies" ) ; }
|
Marks all the proxies from this Neighbour .
| 155
| 10
|
160,190
|
void sweepMarkedProxies ( List topicSpaces , List topics , Transaction transaction , boolean okToForward ) throws SIResourceException , SIException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "sweepMarkedProxies" , new Object [ ] { topicSpaces , topics , transaction , new Boolean ( okToForward ) } ) ; // Get the list of proxies for this Neighbour final Enumeration enu = iProxies . elements ( ) ; // Cycle through each of the proxies while ( enu . hasMoreElements ( ) ) { final MESubscription sub = ( MESubscription ) enu . nextElement ( ) ; // If the subscription is marked, then remove it if ( sub . isMarked ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Subscription " + sub + " being removed" ) ; // Remove the proxy from the list. proxyDeregistered ( sub . getTopicSpaceUuid ( ) , sub . getTopic ( ) , transaction ) ; // Remove this Subscription from the // match space and the item stream on which they are // stored. final boolean proxyDeleted = iNeighbours . deleteProxy ( iDestinationManager . getDestinationInternal ( sub . getTopicSpaceUuid ( ) , false ) , sub , this , sub . getTopicSpaceUuid ( ) , sub . getTopic ( ) , true , false ) ; // Generate the key to remove the subscription from. final String key = BusGroup . subscriptionKey ( sub . getTopicSpaceUuid ( ) , sub . getTopic ( ) ) ; // Remove the proxy from the list iProxies . remove ( key ) ; // Add the details to the list of topics/topicSpaces to be deleted if ( okToForward && proxyDeleted ) { topics . add ( sub . getTopic ( ) ) ; topicSpaces . add ( sub . getTopicSpaceUuid ( ) ) ; } } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sweepMarkedProxies" ) ; }
|
Removes all Subscriptions that are no longer registered
| 500
| 11
|
160,191
|
void sendToNeighbour ( JsMessage message , Transaction transaction ) throws SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "sendToNeighbour" , new Object [ ] { message , transaction } ) ; if ( iProducerSession == null ) createProducerSession ( ) ; try { iProducerSession . send ( ( SIBusMessage ) message , ( SITransaction ) transaction ) ; } catch ( SIException e ) { // No FFDC code needed SibTr . exception ( tc , e ) ; SibTr . warning ( tc , "PUBSUB_CONSISTENCY_ERROR_CWSIP0383" , new Object [ ] { JsAdminUtils . getMENameByUuidForMessage ( iMEUuid . toString ( ) ) , e } ) ; SIResourceException ee = null ; if ( ! ( e instanceof SIResourceException ) ) ee = new SIResourceException ( e ) ; else ee = ( SIResourceException ) e ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendToNeighbour" , ee ) ; throw ee ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "sendToNeighbour" ) ; }
|
Forwards the message given onto this Neighbours Queue .
| 330
| 13
|
160,192
|
protected void recoverSubscriptions ( MultiMEProxyHandler proxyHandler ) throws MessageStoreException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "recoverSubscriptions" , proxyHandler ) ; iProxyHandler = proxyHandler ; iProxies = new Hashtable ( ) ; NonLockingCursor cursor = null ; try { cursor = newNonLockingItemCursor ( new ClassEqualsFilter ( MESubscription . class ) ) ; AbstractItem item = null ; while ( ( item = cursor . next ( ) ) != null ) { MESubscription sub = null ; sub = ( MESubscription ) item ; // Generate a key for the topicSpace/topic final String key = BusGroup . subscriptionKey ( sub . getTopicSpaceUuid ( ) , sub . getTopic ( ) ) ; // Add the Neighbour into the list of recovered Neighbours iProxies . put ( key , sub ) ; // Having created the Proxy, need to readd the proxy to the matchspace or just reference it. iNeighbours . createProxy ( this , iDestinationManager . getDestinationInternal ( sub . getTopicSpaceUuid ( ) , false ) , sub , sub . getTopicSpaceUuid ( ) , sub . getTopic ( ) , true ) ; // When recovering subscriptions, we need to call the event post commit // code to either add a reference, or put in the MatchSpace. sub . eventPostCommitAdd ( null ) ; } } finally { if ( cursor != null ) cursor . finished ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "recoverSubscriptions" ) ; }
|
Recovers the Neighbours subscriptions that it had registered .
| 394
| 12
|
160,193
|
protected void deleteDestination ( ) throws SIConnectionLostException , SIResourceException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteDestination" ) ; // If the producer session hasn't been closed, close it now synchronized ( this ) { if ( iProducerSession != null ) iProducerSession . close ( ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Removing destination " + iRemoteQueue . getDestinationName ( ) ) ; try { iDestinationManager . deleteSystemDestination ( iRemoteQueue ) ; } catch ( SINotPossibleInCurrentConfigurationException e ) { // No FFDC code needed if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Destination " + iRemoteQueue + " already deleted" ) ; } // If the alarm hasn't been cancelled, do it now. synchronized ( this ) { if ( ! iAlarmCancelled ) { if ( iAlarm != null ) iAlarm . cancel ( ) ; iAlarmCancelled = true ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteDestination" ) ; }
|
Deletes the Queue that would be used for sending proxy update messages to this remote ME .
| 322
| 19
|
160,194
|
protected void addPubSubOutputHandler ( PubSubOutputHandler handler ) { if ( iPubSubOutputHandlers == null ) iPubSubOutputHandlers = new HashSet ( ) ; // Add the PubSubOutputHandler to the list that this neighbour // knows about. This is so a recovered neighbour can add the list of // output handlers back into the matchspace. iPubSubOutputHandlers . add ( handler ) ; }
|
Add a PubSubOutputHandler to the list of PubSubOutputHandlers that this neighbour knows about .
| 89
| 21
|
160,195
|
void setRequestedProxySubscriptions ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setRequestedProxySubscriptions" ) ; MPAlarmManager manager = iProxyHandler . getMessageProcessor ( ) . getAlarmManager ( ) ; iAlarm = manager . create ( REQUEST_TIMER , this ) ; synchronized ( this ) { iRequestSent = true ; iAlarmCancelled = false ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setRequestedProxySubscriptions" ) ; }
|
Indicate that we have sent a request message to this neighbour .
| 155
| 13
|
160,196
|
void setRequestedProxySubscriptionsResponded ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setRequestedProxySubscriptionsResponded" ) ; synchronized ( this ) { iRequestSent = false ; if ( ! iAlarmCancelled ) iAlarm . cancel ( ) ; iAlarmCancelled = true ; } String meName = JsAdminUtils . getMENameByUuidForMessage ( iMEUuid . toString ( ) ) ; if ( meName == null ) meName = iMEUuid . toString ( ) ; SibTr . push ( iProxyHandler . getMessageProcessor ( ) . getMessagingEngine ( ) ) ; SibTr . info ( tc , "NEIGHBOUR_REPLY_RECIEVED_INFO_CWSIP0382" , new Object [ ] { meName } ) ; SibTr . pop ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setRequestedProxySubscriptionsResponded" ) ; }
|
The request for proxy subscriptions was responded to .
| 265
| 9
|
160,197
|
boolean wasProxyRequestSent ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "wasProxyRequestSent" ) ; SibTr . exit ( tc , "wasProxyRequestSent" , new Boolean ( iRequestSent ) ) ; } return iRequestSent ; }
|
If a request message was sent to this neighbour for the proxy subscriptions
| 78
| 13
|
160,198
|
protected void deleteSystemDestinations ( ) throws SIConnectionLostException , SIResourceException , SIErrorException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "deleteSystemDestinations" ) ; // If the producer session hasn't been closed, close it now synchronized ( this ) { if ( iProducerSession != null ) iProducerSession . close ( ) ; } //Get all the system destinations tht need to be deleted List systemDestinations = iDestinationManager . getAllSystemDestinations ( iMEUuid ) ; Iterator itr = systemDestinations . iterator ( ) ; while ( itr . hasNext ( ) ) { JsDestinationAddress destAddress = ( JsDestinationAddress ) itr . next ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Removing destination " + destAddress . getDestinationName ( ) ) ; try { iDestinationManager . deleteSystemDestination ( destAddress ) ; } catch ( SINotPossibleInCurrentConfigurationException e ) { // No FFDC code needed if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "Destination " + destAddress + " already deleted" ) ; } } // If the alarm hasn't been cancelled, do it now. synchronized ( this ) { if ( ! iAlarmCancelled ) { if ( iAlarm != null ) iAlarm . cancel ( ) ; iAlarmCancelled = true ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "deleteSystemDestinations" ) ; }
|
Deletes all remote system destinations that are on referencing the me that this neighbour is referenced too .
| 403
| 19
|
160,199
|
private boolean checkForeignSecurityAttributesChanged ( MESubscription sub , boolean foreignSecuredProxy , String MESubUserId ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "checkForeignSecurityAttributesChanged" , new Object [ ] { sub , new Boolean ( foreignSecuredProxy ) , MESubUserId } ) ; boolean attrChanged = false ; if ( foreignSecuredProxy ) { if ( sub . isForeignSecuredProxy ( ) ) { // Need to check the userids if ( MESubUserId != null ) { if ( sub . getMESubUserId ( ) != null ) { // Neither string is null, check whether they // are equal if ( ! MESubUserId . equals ( sub . getMESubUserId ( ) ) ) { sub . setMESubUserId ( MESubUserId ) ; attrChanged = true ; } } else { // Stored subscription was null sub . setMESubUserId ( MESubUserId ) ; attrChanged = true ; } } else // MESubUserid is null { if ( sub . getMESubUserId ( ) != null ) { sub . setMESubUserId ( null ) ; attrChanged = true ; } } } else { // The stored subscription was not foreign secured sub . setForeignSecuredProxy ( true ) ; sub . setMESubUserId ( MESubUserId ) ; attrChanged = true ; } } else // the new proxy sub is not foreign secured { if ( sub . isForeignSecuredProxy ( ) ) { // The stored subscription was foreign secured sub . setForeignSecuredProxy ( false ) ; sub . setMESubUserId ( null ) ; attrChanged = true ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "checkForeignSecurityAttributesChanged" , new Boolean ( attrChanged ) ) ; return attrChanged ; }
|
checkForeignSecurityAttributesChanged is called in order to determine whether security attributes have changed .
| 449
| 17
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.