idx
int64
0
41.2k
question
stringlengths
73
5.81k
target
stringlengths
5
918
25,200
private void createFileMonitor ( ) { try { ltpaFileMonitor = new SecurityFileMonitor ( this ) ; setFileMonitorRegistration ( ltpaFileMonitor . monitorFiles ( Arrays . asList ( keyImportFile ) , monitorInterval ) ) ; } catch ( Exception e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { T...
Handles the creation of the LTPA file monitor .
25,201
public void performFileBasedAction ( Collection < File > files ) { Tr . audit ( tc , "LTPA_KEYS_TO_LOAD" , keyImportFile ) ; submitTaskToCreateLTPAKeys ( ) ; }
Submits an asynchronous task to load the LTPA keys based on the current configuration state . This method might also be called by the file monitor when there is an update to the LTPA keys file or when the file is recreated after it is deleted .
25,202
private boolean isKeysConfigChanged ( String oldKeyImportFile , Long oldKeyTokenExpiration ) { return ( ( oldKeyImportFile . equals ( keyImportFile ) == false ) || ( oldKeyTokenExpiration != keyTokenExpiration ) ) ; }
The keys config is changed if the file or expiration were modified . Changing the password by itself must not be considered a config change that should trigger a keys reload .
25,203
public boolean put ( DeliveryDelayableReference deliveryDelayableReference ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "put" , "ObjId=" + deliveryDelayableReference . getID ( ) + " ET=" + deliveryDelayableReference . getDeliveryDelayTime ( ) ) ; boolean rep...
Add an DeliveryDelayableReference to the DeliveryDelay index .
25,204
public boolean isSameRM ( XAResource xares ) throws XAException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "isSameRM" , xares ) ; XAResource actualXARes = xares ; if ( xares instanceof SuspendableXAResource ) { actualXARes = ( ( SuspendableXAResource ) xares...
In this method we must ensure that we unpack the appropriate XAResource if appropriate from the SuspendableXAResource instance if one was passed in .
25,205
public static WrapperProxyState getWrapperProxyState ( Object proxy ) { if ( proxy instanceof BusinessLocalWrapperProxy ) { return ( ( BusinessLocalWrapperProxy ) proxy ) . ivState ; } if ( proxy instanceof EJSLocalWrapperProxy ) { return ( ( EJSLocalWrapperProxy ) proxy ) . ivState ; } if ( proxy instanceof LocalBeanW...
Return the state for a wrapper proxy .
25,206
private GenericData map2GenericData ( GenericData gdo , Map < String , Object > map ) { for ( Entry < String , Object > entry : map . entrySet ( ) ) { if ( entry . getValue ( ) == null ) { if ( entry . getKey ( ) . equals ( AuditEvent . TARGET_APPNAME ) ) { gdo . addPair ( entry . getKey ( ) , AuditUtils . getJ2EECompo...
Given a Map add the corresponding audit data to the given GenericData object .
25,207
public static void setCustomHeaderFormat ( String [ ] headerFormat ) { customFormat = new String [ headerFormat . length ] ; System . arraycopy ( headerFormat , 0 , customFormat , 0 , headerFormat . length ) ; }
Set custom format to use printing header information .
25,208
public static Properties getHeaderAsProperties ( ) { Properties result = new Properties ( ) ; if ( customProps != null ) { result . putAll ( customProps ) ; } result . put ( ServerInstanceLogRecordList . HEADER_PROCESSID , processId ) ; result . put ( ServerInstanceLogRecordList . HEADER_SERVER_TIMEZONE , TimeZone . ge...
Gets Header information as a Propeties instance .
25,209
private final static void printStackTrace ( Throwable t , PrintWriter p ) { if ( t == null ) { p . println ( "none" ) ; return ; } try { t . printStackTrace ( p ) ; } catch ( Throwable e ) { p . println ( "<Encountered exception while printing stack trace>" ) ; p . println ( e . getClass ( ) . getName ( ) + ": " + e . ...
Format the backtrace for the given Throwable onto the given PrintWriter .
25,210
public static String threadIdToString ( int threadId ) { StringBuffer buffer = new StringBuffer ( 8 ) ; for ( int shift = 7 ; shift >= 0 ; shift -- ) { buffer . append ( hexChars [ ( threadId >> ( shift << 2 ) ) & 0xF ] ) ; } return buffer . toString ( ) ; }
Converts provided thread id into eight character hexadecimal string
25,211
private final static String escape ( String src ) { if ( src == null ) { return "" ; } StringBuffer result = null ; for ( int i = 0 , max = src . length ( ) , delta = 0 ; i < max ; i ++ ) { char c = src . charAt ( i ) ; if ( ! Character . isWhitespace ( c ) && Character . isISOControl ( c ) || Character . getType ( c )...
D512713 - method to convert non - printable chars into a printable string for the log .
25,212
static DateFormat getBasicDateFormatter ( ) { String pattern ; int patternLength ; int endOfSecsIndex ; DateFormat formatter = DateFormat . getDateTimeInstance ( DateFormat . SHORT , DateFormat . MEDIUM ) ; if ( formatter instanceof SimpleDateFormat ) { SimpleDateFormat sdFormatter = ( SimpleDateFormat ) formatter ; pa...
Return a DateFormat object that can be used to format timestamps in the System . out System . err and TraceOutput logs .
25,213
public static XAException createXAException ( String key , Object args , int xaErrorCode ) { XAException xaX = new XAException ( args == null ? getNLSMessage ( key ) : getNLSMessage ( key , args ) ) ; xaX . errorCode = xaErrorCode ; return xaX ; }
Create an XAException with a translated error message and an XA error code . The XAException constructors provided by the XAException API allow only for either an error message or an XA error code to be specified . This method constructs an XAException with both . The error message is created from the NLS key and argum...
25,214
public static String getConcurrencyModeString ( int concurrency ) { switch ( concurrency ) { case ResultSet . CONCUR_READ_ONLY : return "CONCUR READ ONLY (" + concurrency + ')' ; case ResultSet . CONCUR_UPDATABLE : return "CONCUR UPDATABLE (" + concurrency + ')' ; case CONCUR_SS_SCROLL_LOCKS : return "CONCUR SS SCROLL ...
Display the java . sql . ResultSet concurrency mode constant corresponding to the value supplied .
25,215
public static String getConnectionEventString ( int eventID ) { switch ( eventID ) { case ConnectionEvent . CONNECTION_CLOSED : return "CONNECTION CLOSED (" + eventID + ')' ; case ConnectionEvent . LOCAL_TRANSACTION_STARTED : return "LOCAL TRANSACTION STARTED (" + eventID + ')' ; case ConnectionEvent . LOCAL_TRANSACTIO...
Display the name of the ConnectionEvent constant given the event id .
25,216
public static String getFetchDirectionString ( int direction ) { switch ( direction ) { case ResultSet . FETCH_FORWARD : return "FETCH FORWARD (" + direction + ')' ; case ResultSet . FETCH_REVERSE : return "FETCH REVERSE (" + direction + ')' ; case ResultSet . FETCH_UNKNOWN : return "FETCH UNKNOWN (" + direction + ')' ...
Display the java . sql . ResultSet fetch direction constant corresponding to the value supplied .
25,217
public static String getIsolationLevelString ( int level ) { switch ( level ) { case Connection . TRANSACTION_NONE : return "NONE (" + level + ')' ; case Connection . TRANSACTION_READ_UNCOMMITTED : return "READ UNCOMMITTED (" + level + ')' ; case Connection . TRANSACTION_READ_COMMITTED : return "READ COMMITTED (" + lev...
Display the java . sql . Connection isolation level constant corresponding to the value supplied .
25,218
public static final String getNLSMessage ( String key , Object ... args ) { return Tr . formatMessage ( tc , key , args ) ; }
Retrieve the message corresponding to the supplied key from the IBMDataStoreAdapterNLS properties file . If the message cannot be found the key is returned .
25,219
public static String getResultSetTypeString ( int type ) { switch ( type ) { case ResultSet . TYPE_FORWARD_ONLY : return "TYPE FORWARD ONLY (" + type + ')' ; case ResultSet . TYPE_SCROLL_INSENSITIVE : return "TYPE SCROLL INSENSITIVE (" + type + ')' ; case ResultSet . TYPE_SCROLL_SENSITIVE : return "TYPE SCROLL SENSITIV...
Display the java . sql . ResultSet result set type constant corresponding to the value supplied .
25,220
public static String getSQLTypeString ( int sqlType ) { switch ( sqlType ) { case Types . ARRAY : return "ARRAY (" + sqlType + ')' ; case Types . BIGINT : return "BIGINT (" + sqlType + ')' ; case Types . BINARY : return "BINARY (" + sqlType + ')' ; case Types . BIT : return "BIT (" + sqlType + ')' ; case Types . BLOB :...
Display the java . sql . Types SQL Type constant corresponding to the value supplied .
25,221
public static String getXAExceptionCodeString ( int code ) { switch ( code ) { case XAException . XA_RBTRANSIENT : return "XA_RBTRANSIENT (" + code + ')' ; case XAException . XA_RBROLLBACK : return "XA_RBROLLBACK (" + code + ')' ; case XAException . XA_HEURCOM : return "XA_HEURCOM (" + code + ')' ; case XAException . X...
Used by trace facilities to print out XAException code as a string
25,222
public static String getXAResourceEndFlagString ( int flag ) { switch ( flag ) { case XAResource . TMFAIL : return "TMFAIL (" + flag + ')' ; case XAResource . TMSUCCESS : return "TMSUCCESS (" + flag + ')' ; case XAResource . TMSUSPEND : return "TMSUSPEND (" + flag + ')' ; } return "UNKNOWN XA RESOURCE END FLAG (" + fla...
Display the javax . xa . XAResource end flag constant corresponding to the value supplied .
25,223
public static String getXAResourceRecoverFlagString ( int flag ) { switch ( flag ) { case XAResource . TMENDRSCAN : return "TMENDRSCAN (" + flag + ')' ; case XAResource . TMNOFLAGS : return "TMNOFLAGS (" + flag + ')' ; case XAResource . TMSTARTRSCAN : return "TMSTARTRSCAN (" + flag + ')' ; case XAResource . TMSTARTRSCA...
Display the javax . xa . XAResource recover flag constant corresponding to the value supplied .
25,224
public static String getXAResourceStartFlagString ( int flag ) { switch ( flag ) { case XAResource . TMJOIN : return "TMJOIN (" + flag + ')' ; case XAResource . TMNOFLAGS : return "TMNOFLAGS (" + flag + ')' ; case XAResource . TMRESUME : return "TMRESUME (" + flag + ')' ; } return "UNKNOWN XA RESOURCE START FLAG (" + f...
Display the javax . xa . XAResource start flag constant corresponding to the value supplied .
25,225
public static String getXAResourceVoteString ( int vote ) { switch ( vote ) { case XAResource . XA_OK : return "XA_OK (" + vote + ')' ; case XAResource . XA_RDONLY : return "XA_RDONLY (" + vote + ')' ; } return "UNKNOWN XA RESOURCE VOTE (" + vote + ')' ; }
Display the javax . xa . XAResource Resource Manager vote constant corresponding to the value supplied .
25,226
public static final SQLException notSupportedX ( String operation , Throwable cause ) { SQLException sqlX = new SQLFeatureNotSupportedException ( getNLSMessage ( "FEATURE_NOT_IMPLEMENTED" , operation ) ) ; if ( cause != null ) sqlX . initCause ( cause ) ; return sqlX ; }
Creates an exception indicating the requested operation is not supported .
25,227
public static final void suppressBeginAndEndRequest ( ) { if ( ! warnedAboutBeginAndEndRequest ) { warnedAboutBeginAndEndRequest = true ; StringBuilder stack = new StringBuilder ( ) ; for ( StackTraceElement frame : new Exception ( ) . getStackTrace ( ) ) stack . append ( EOLN ) . append ( frame . toString ( ) ) ; Tr ....
Logs a warning message indicating that Connection . beginRequest and Connection . endRequest methods are suppressed .
25,228
public static ResourceException translateSQLException ( SQLException se , Object mapper , boolean sendEvent , Class < ? > caller ) { return ( ResourceException ) mapException ( new DataStoreAdapterException ( "DSA_ERROR" , se , caller , se . getMessage ( ) ) , null , mapper , sendEvent ) ; }
Translates a SQLException from the database . The exception mapping methods have been rewritten to account for the error detection model and to consolidate the RRA exception mapping routines into a single place . See the AdapterUtil . mapException method .
25,229
public static SQLException toSQLException ( ResourceException resX ) { if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "toSQLException" , resX ) ; SQLException sqlX = null ; for ( Throwable linkedX = resX ; linkedX != null ; linkedX = getChainedException ( linkedX ) ) { if ( linkedX instanceof SQLException ) { sqlX = ...
Converts a ResourceException to a SQLException . Returns the first chained exception found to be a SQLException or ConnectionWaitTimeoutException . If none of the chained chained exceptions are SQLExceptions or ConnectionWaitTimeoutExceptions a new SQLException is created containing information from the ResourceExcepti...
25,230
public static SQLException toSQLException ( Throwable ex ) { if ( ex == null ) return null ; if ( ex instanceof SQLException ) return ( SQLException ) ex ; if ( ex instanceof ResourceException ) return toSQLException ( ( ResourceException ) ex ) ; SQLException sqlX = new SQLException ( ex . getClass ( ) . getName ( ) +...
Converts any generic Exception to a SQLException .
25,231
public static StringBuilder getStackTraceWithState ( SQLException sqle ) { SQLException sqlX = sqle ; boolean isLinkedThrowable = false ; StringBuilder trace = new StringBuilder ( EOLN ) ; SQLException tempSqlX ; do { StringWriter s = new StringWriter ( ) ; PrintWriter p = new PrintWriter ( s ) ; sqlX . printStackTrace...
This method returns a StringBuffer which includes SQL state error code and stack trace of the passed - in SQLException and all its linked exception .
25,232
public static String getResultSetCloseString ( int value ) { switch ( value ) { case Statement . CLOSE_ALL_RESULTS : return "CLOSE ALL RESULTS (" + value + ')' ; case Statement . CLOSE_CURRENT_RESULT : return "CLOSE CURRENT RESULT (" + value + ')' ; case Statement . KEEP_CURRENT_RESULT : return "KEEP CURRENT RESULT (" ...
Display the java . sql . Statement ResultSet close constant corresponding to the value supplied .
25,233
public static String getCursorHoldabilityString ( int value ) { switch ( value ) { case ResultSet . CLOSE_CURSORS_AT_COMMIT : return "CLOSE CURSORS AT COMMIT (" + value + ')' ; case ResultSet . HOLD_CURSORS_OVER_COMMIT : return "HOLD CURSORS OVER COMMIT (" + value + ')' ; case 0 : return "DEFAULT CURSOR HOLDABILITY VAL...
Display the java . sql . ResultSet cursor holdability constant corresponding to the value supplied .
25,234
public static String getAutoGeneratedKeyString ( int autoGeneratedKey ) { switch ( autoGeneratedKey ) { case Statement . NO_GENERATED_KEYS : return "NO GENERATED KEYS (" + autoGeneratedKey + ')' ; case Statement . RETURN_GENERATED_KEYS : return "RETURN GENERATED KEYS (" + autoGeneratedKey + ')' ; } return "UNKNOWN AUTO...
Display the auto genereated key constant corresponding to the value supplied .
25,235
public static SQLException mapSQLException ( SQLException se , Object mapper ) { return ( SQLException ) mapException ( se , null , mapper , true ) ; }
Translates a SQLException from the database . Exception mapping code is now consolidated into AdapterUtil . mapException .
25,236
public static boolean isUnsupportedException ( SQLException sqle ) { if ( sqle instanceof SQLFeatureNotSupportedException ) return true ; String state = sqle . getSQLState ( ) == null ? "" : sqle . getSQLState ( ) ; int code = sqle . getErrorCode ( ) ; return state . startsWith ( "0A" ) || 0x0A000 == code || state . st...
Identifies if an exception indicates an unsupported operation .
25,237
public static void setLocale ( Locale locale ) { if ( RepositoryUtils . locale == null ) { RepositoryUtils . locale = locale ; } else { if ( RepositoryUtils . locale != locale ) { RepositoryUtils . locale = locale ; messages = null ; installMessages = null ; } } }
This method sets the Locale value for the repository based on input .
25,238
public static String getMessage ( String key , Object ... args ) { if ( messages == null ) { if ( locale == null ) locale = Locale . getDefault ( ) ; messages = ResourceBundle . getBundle ( "com.ibm.ws.install.internal.resources.Repository" , locale ) ; } String message = messages . getString ( key ) ; if ( args . leng...
Get the message corresponding to the key and Repository locale .
25,239
public static boolean matchAppliesTo ( String assetType , String assetName , String fileName , String appliesTo , String productId , String productVersion , String productInstallType , String productLcenseType , String productEdition ) { if ( appliesTo == null ) return true ; List < AppliesToFilterInfo > atfis = Applie...
Parses through the appliesTo header and checks if all parameters of the header matches the input values .
25,240
private Object getJSONValue ( Object value , Set < String > processed ) throws IOException { if ( value instanceof String ) { String s = ( String ) value ; if ( s . matches ( ".*_\\d+" ) ) { Configuration [ ] c ; try { String filter = FilterUtils . createPropertyFilter ( "service.pid" , s ) ; if ( TraceComponent . isAn...
Converts the specified value to one that can be included in JSON
25,241
private static final String getUID ( String configDisplayId , String id ) { return id == null || configDisplayId . matches ( ".*/.*\\[.*\\].*" ) ? configDisplayId : id ; }
Compute the unique identifier from the id and config . displayId . If a top level configuration element has an id the id is the unique identifier . Otherwise the config . displayId is the unique identifier .
25,242
private void reconstituteMQLink ( int startMode ) throws MessageStoreException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reconstituteMQLink" , new Object [ ] { Integer . valueOf ( startMode ) , this } ) ; int localisationCount = 0 ; MQLinkMe...
Reconstitute the MQLink itemstream if it exists .
25,243
private void reconstituteLocalQueuePoint ( int startMode , boolean isSystem ) throws MessageStoreException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reconstituteLocalQueuePoint" , new Object [ ] { Integer . valueOf ( startMode ) , Boolean . ...
Reconstitute the local queue point if it exists .
25,244
private void reconstituteRemoteQueuePoints ( int startMode , boolean isSystem ) throws SIDiscriminatorSyntaxException , MessageStoreException , SIResourceException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reconstituteRemoteQueuePoints" , new Object [ ] { Integer...
Reconstitute any remote queue points .
25,245
public void clearLocalisingUuidsSet ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "clearLocalisingUuidsSet" , this ) ; _localisationManager . clearLocalisingUuidsSet ( ) ; _pToPLocalMsgsItemStream = null ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEn...
Method clearLocalisingUuidsSet . Clear the set of ME s that localise the destination
25,246
public void runtimeEventOccurred ( MPRuntimeEvent event ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "runtimeEventOccurred" , new Object [ ] { event , this } ) ; if ( _pToPLocalMsgsItemStream != null ) { _pToPLocalMsgsItemStream . getControlAdapter ( ) . runtimeEve...
Method runtimeEventOccurred .
25,247
public boolean isReallocationRequired ( ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( this , tc , "isReallocationRequired" ) ; SibTr . exit ( tc , "isReallocationRequired" , Boolean . valueOf ( reallocateOnCommit ) ) ; } return reallocateOnCommit ; }
Is reallocation of the msg required on its postcommit callback
25,248
public void println ( final String str ) throws IOException { this . writer . print ( str ) ; this . writer . print ( "\r\n" ) ; this . writer . flush ( ) ; }
Send String to socket .
25,249
public void handleCommand ( ) throws IOException { this . currentLine = this . reader . readLine ( ) ; if ( this . currentLine == null ) { LOGGER . severe ( "Current line is null!" ) ; this . exit ( ) ; return ; } final StringTokenizer st = new StringTokenizer ( this . currentLine , " " ) ; final String commandName = s...
Handle command .
25,250
public void list ( ) throws IOException { this . writer . println ( "+OK" ) ; this . writer . println ( "1 " + msg1 . length ( ) ) ; this . writer . println ( "2 " + msg2 . length ( ) ) ; this . println ( "." ) ; }
LIST command .
25,251
public void retr ( String arg ) throws IOException { String msg ; if ( arg . equals ( "1" ) ) msg = msg1 ; else msg = msg2 ; this . println ( "+OK " + msg . length ( ) + " octets" ) ; this . writer . write ( msg ) ; this . println ( "." ) ; }
RETR command .
25,252
public void top ( String arg ) throws IOException { String top ; if ( arg . equals ( "1" ) ) top = top1 ; else top = top2 ; this . println ( "+OK " + top . length ( ) + " octets" ) ; this . writer . write ( top ) ; this . println ( "." ) ; }
TOP command . XXX - ignores number of lines argument
25,253
public long getFirstTimeout ( ) { long lastTimeout = Math . max ( System . currentTimeMillis ( ) , start ) ; if ( lastTimeout > end ) { return - 1 ; } return getTimeout ( lastTimeout , false ) ; }
Determines the first timeout of the schedule expression .
25,254
private Calendar createCalendar ( long time ) { Calendar cal = new GregorianCalendar ( timeZone ) ; cal . setTimeInMillis ( time ) ; return cal ; }
Creates a calendar object for the specified time using the time zone of the schedule expression .
25,255
private static void advance ( Calendar cal , int field , int nextField , long haystack , int needle ) { long higher = higher ( haystack , needle ) ; if ( higher != 0 ) { cal . set ( field , first ( higher ) ) ; } else { cal . set ( field , first ( haystack ) ) ; cal . add ( nextField , 1 ) ; } }
Moves the value of the specified field forward in time to satisfy constraints of the specified bitmask . If a position higher than needle is found in haystack then that higher position is set as the value in field . Otherwise the lowest value in haystack is set as the value in field and the value in nextField is increm...
25,256
private boolean advanceYear ( Calendar cal , int year ) { year = years . nextSetBit ( year + 1 - ScheduleExpressionParser . MINIMUM_YEAR ) ; if ( year >= 0 ) { cal . set ( Calendar . YEAR , year + ScheduleExpressionParser . MINIMUM_YEAR ) ; return true ; } return false ; }
Moves the value of the year field forward in time to satisfy the year constraint .
25,257
public void connect ( String hostName , int port ) throws UnknownHostException , IOException { if ( ! sslHelper . isSocketAvailable ( ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event ( tc , "creating/recreating socket connection to " + hostName + ":" + port ) ; SSLSocket socke...
Creates a socket using TLS protocol and connects it to the specified host and port .
25,258
public boolean isConnectionStale ( ) { if ( lastUsedTime == 0 ) return false ; long currentTime = System . currentTimeMillis ( ) ; long timeSinceLastUse = currentTime - lastUsedTime ; return ( timeSinceLastUse > MAX_KEEPALIVE ) ; }
Checks whether or not this connection has been used recently enough to still be considered usable
25,259
public void writeWindowFrame ( int windowSize ) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream ( ) ; output . write ( PROTOCOL_VERSION . getBytes ( UTF_8 ) ) ; output . write ( WINDOW_SIZE_FRAME_TYPE . getBytes ( UTF_8 ) ) ; output . write ( ByteBuffer . allocate ( 4 ) . putInt ( windowSi...
Write a window frame to the wire .
25,260
public void writeFrame ( byte [ ] frame ) throws IOException { lastUsedTime = System . currentTimeMillis ( ) ; out . write ( frame ) ; out . flush ( ) ; }
Write a frame in bytes to the wire . This method is useful for writing a data or a compressed frame to the wire .
25,261
public void readAckFrame ( ) throws IOException { byte [ ] buffer = new byte [ 6 ] ; int bytesReceived = 0 ; while ( ( bytesReceived = bytesReceived + in . read ( buffer , bytesReceived , buffer . length - bytesReceived ) ) != - 1 ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) Tr . event...
Reads ack frames in bytes from the wire . This method blocks till all the acks are received for frames written to the wire .
25,262
public byte [ ] createDataFrames ( List < Object > dataObjects ) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream ( ) ; for ( int i = 0 ; i < dataObjects . size ( ) ; i ++ ) { ByteArrayOutputStream dataObjectStream = new ByteArrayOutputStream ( ) ; @ SuppressWarnings ( "unchecked" ) Lumberj...
Creates data frames for lumberjack protocol
25,263
public byte [ ] createCompressedFrame ( byte [ ] dataFrames ) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream ( ) ; output . write ( dataFrames ) ; byte [ ] cBytes = new byte [ output . size ( ) ] ; deflater . setInput ( output . toByteArray ( ) ) ; deflater . finish ( ) ; int compressedLe...
Creates a compressed frame for lumberjack protocol .
25,264
private void ensureFactoryValidator ( ClassLoader appCl ) { config . addProperty ( "bval.before.cdi" , "true" ) ; factory = BeanValidationExtensionHelper . validatorFactoryAccessorProxy ( appCl ) ; if ( appCl . toString ( ) . contains ( "com.ibm.ws.classloading.internal.AppClassLoader@" ) ) { instance ( ) . factory = f...
lazily to get a small luck to have CDI in place
25,265
public static < T > Releasable < T > inject ( final Class < T > clazz ) { try { final BeanManager beanManager = CDI . current ( ) . getBeanManager ( ) ; if ( beanManager == null ) { return null ; } final AnnotatedType < T > annotatedType = beanManager . createAnnotatedType ( clazz ) ; final InjectionTarget < T > it = b...
Request that an instance of the specified type be provided by the container .
25,266
public String getName ( ) { if ( null == this . name && null != this . byteArray ) { try { this . name = new String ( this . byteArray , HeaderStorage . ENGLISH_CHARSET ) ; } catch ( UnsupportedEncodingException uee ) { throw new IllegalArgumentException ( "Unsupported non-English name: " + new String ( this . byteArra...
Query the name for this key as a String .
25,267
public boolean isIsolationLevelSwitchingSupport ( ) { if ( ! switchingSupportDetermined ) { os400Version_ = AccessController . doPrivileged ( new PrivilegedAction < String > ( ) { public String run ( ) { return System . getProperty ( "os.version" ) ; } } ) ; os400VersionNum_ = generateVersionNumber ( os400Version_ ) ; ...
This method returns the indicator whether the backend supports the isolation level switching on a connection
25,268
public synchronized void setRepositoryInfo ( LogRepositoryManager manager , File repositoryLocation , long repositorySpaceNeeded ) throws IllegalArgumentException { if ( manager == null ) throw new IllegalArgumentException ( "Null manager passed to LogRepositorySpaceAlert.setRepositoryInfo" ) ; if ( repositoryLocation ...
Set a repository into the space alert for checking . In HPEL the LogManager for log and the LogManager for Trace should set themselves as repositories to watch . This is done on the opening of each file . Thus if a destination is moved a file is rolled or a server is started the info will be updated
25,269
private synchronized void checkFileSystems ( ) { for ( Entry < File , FileSystemInfo > fsEntry : fsInfo . entrySet ( ) ) { if ( fsEntry . getValue ( ) . processThisCycle ( ) ) { long fsFreeSpace = AccessHelper . getFreeSpace ( fsEntry . getKey ( ) ) ; if ( logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level ...
check the file systems to see if there is ample room Gets information from configuration and correlates it to the space left on the volume to see if it looks like we are in jeopardy . An attempt is made to determine if log and trace are on the same fs . If so then the combined impact is assessed .
25,270
public static Class < ? > loadClassByName ( String className ) throws ClassNotFoundException { try { return Class . forName ( className ) ; } catch ( ClassNotFoundException e ) { return Thread . currentThread ( ) . getContextClassLoader ( ) . loadClass ( className ) ; } }
Load Class by class name . If class not found in it s Class loader or one of the parent class loaders - delegate to the Thread s ContextClassLoader
25,271
public static boolean isOverriddenMethod ( Method methodToFind , Class < ? > cls ) { Set < Class < ? > > superClasses = new HashSet < > ( ) ; for ( Class < ? > class1 : cls . getInterfaces ( ) ) { superClasses . add ( class1 ) ; } if ( cls . getSuperclass ( ) != null ) { superClasses . add ( cls . getSuperclass ( ) ) ;...
Checks if the method methodToFind is the overridden method from the superclass or superinterface .
25,272
public static Method getOverriddenMethod ( Method method ) { Class < ? > declaringClass = method . getDeclaringClass ( ) ; Class < ? > superClass = declaringClass . getSuperclass ( ) ; Method result = null ; if ( superClass != null && ! ( superClass . equals ( Object . class ) ) ) { result = findMethod ( method , super...
Returns overridden method from superclass if it exists . If method was not found returns null .
25,273
public static Method findMethod ( Method methodToFind , Class < ? > cls ) { if ( cls == null ) { return null ; } String methodToSearch = methodToFind . getName ( ) ; Class < ? > [ ] soughtForParameterType = methodToFind . getParameterTypes ( ) ; Type [ ] soughtForGenericParameterType = methodToFind . getGenericParamete...
Searches the method methodToFind in given class cls . If the method is found returns it else return null .
25,274
public static < A extends Annotation > A getAnnotation ( Method method , Class < A > annotationClass ) { A annotation = method . getAnnotation ( annotationClass ) ; if ( annotation == null ) { for ( Annotation metaAnnotation : method . getAnnotations ( ) ) { annotation = metaAnnotation . annotationType ( ) . getAnnotat...
Returns an annotation by type from a method .
25,275
public static < A extends Annotation > List < A > getRepeatableAnnotations ( Method method , Class < A > annotationClass ) { A [ ] annotations = method . getAnnotationsByType ( annotationClass ) ; if ( annotations == null || annotations . length == 0 ) { for ( Annotation metaAnnotation : method . getAnnotations ( ) ) {...
Returns a List of repeatable annotations by type from a method .
25,276
public static boolean isVoid ( Type type ) { final Class < ? > cls = TypeFactory . defaultInstance ( ) . constructType ( type ) . getRawClass ( ) ; return Void . class . isAssignableFrom ( cls ) || Void . TYPE . isAssignableFrom ( cls ) ; }
Checks if the type is void .
25,277
private AuthenticationResult handleJwtSSO ( HttpServletRequest req , HttpServletResponse res ) { String jwtCookieName = JwtSSOTokenHelper . getJwtCookieName ( ) ; if ( jwtCookieName == null ) { return null ; } String encodedjwtssotoken = ssoCookieHelper . getJwtSsoTokenFromCookies ( req , jwtCookieName ) ; if ( encoded...
If there is no jwtSSOToken we will return null . Otherwise we will AuthenticationResult .
25,278
private boolean isTokenLoggedOut ( String ltpaToken ) { boolean loggedOut = false ; Object entry = LoggedOutTokenCacheImpl . getInstance ( ) . getDistributedObjectLoggedOutToken ( ltpaToken ) ; if ( entry != null ) loggedOut = true ; return loggedOut ; }
Check to see if the token has been logged out .
25,279
private AuthenticationData createAuthenticationData ( HttpServletRequest req , HttpServletResponse res , String token , String oid ) { AuthenticationData authenticationData = new WSAuthenticationData ( ) ; authenticationData . set ( AuthenticationData . HTTP_SERVLET_REQUEST , req ) ; authenticationData . set ( Authenti...
Create an authentication data for ltpaToken
25,280
public static long registerNatives ( Class < ? > clazz , String nativeDescriptorName , Object [ ] extraInfo ) { if ( ! initialized ) { if ( loadFailure != null ) { Error e = new UnsatisfiedLinkError ( ) ; e . initCause ( loadFailure ) ; throw e ; } else { return 0 ; } } return ntv_registerNatives ( clazz , nativeDescri...
Register native methods from the core DLL for the specified class and drive the registration hooks .
25,281
public static long deregisterNatives ( long dllHandle , Class < ? > clazz , String nativeDescriptorName , Object [ ] extraInfo ) { if ( ! initialized ) { if ( loadFailure != null ) { Error e = new UnsatisfiedLinkError ( ) ; e . initCause ( loadFailure ) ; throw e ; } else { return 0 ; } } return ntv_deregisterNatives (...
Drive the deregistration hooks the native methods from the core DLL for the specified class .
25,282
public static HpelFormatter getFormatter ( String formatStyle ) { if ( formatStyle != null && ! "" . equals ( formatStyle ) ) { if ( formatStyle . equalsIgnoreCase ( FORMAT_BASIC ) ) { return new HpelBasicFormatter ( ) ; } else if ( formatStyle . equalsIgnoreCase ( FORMAT_ADVANCED ) ) { return new HpelAdvancedFormatter...
Returns the HpelFormatter subclass instance to be used for formatting a RepositoryLogRecord . The formatter returned is based on the formatStyle requested .
25,283
public static void addCustomLevel ( Level level , String id ) { if ( level == null ) { throw new IllegalArgumentException ( "Parameter level can not be 'null' in this call" ) ; } if ( id == null ) { id = level . getName ( ) . substring ( 0 , 1 ) ; } customLevels . put ( level , id ) ; }
Adds level to be treated specially by this formatter .
25,284
public void setCustomHeader ( String [ ] header ) { if ( header == null ) { throw new IllegalArgumentException ( "Custom header can't be null." ) ; } customHeader = new CustomHeaderLine [ header . length ] ; for ( int i = 0 ; i < header . length ; i ++ ) { customHeader [ i ] = new CustomHeaderLine ( header [ i ] ) ; } ...
sets new customer header format specification
25,285
public void setTimeZoneID ( String timeZoneId ) { if ( verifyTimeZoneID ( timeZoneId ) ) { this . timeZone = TimeZone . getTimeZone ( timeZoneId ) ; } else { throw new IllegalArgumentException ( timeZoneId + " is not a valid time zone" ) ; } }
Sets the ID of the time zone to be used in the formatted log record header timestamp
25,286
protected String formatUnlocalized ( String traceString , Object [ ] parms ) { Object [ ] newParms = convertParameters ( parms ) ; if ( newParms == null ) return traceString ; else { String formattedTrace ; if ( traceString . indexOf ( '{' ) >= 0 ) { formattedTrace = Messages . getFormattedMessageFromLocalizedMessage (...
Used for WsLogRecords or CommonBaseEventLogRecords that specify REQUIRES_NO_LOCALIZATION
25,287
public String formatRecord ( RepositoryLogRecord record ) { if ( null == record ) { throw new IllegalArgumentException ( "Record cannot be null" ) ; } return formatRecord ( record , ( Locale ) null ) ; }
Formats a RepositoryLogRecord using the formatter s locale
25,288
public static String getApplicationName ( BundleContext bundleContext ) { String applicationName = null ; if ( FrameworkState . isValid ( ) ) { ComponentMetaData cmd = ComponentMetaDataAccessorImpl . getComponentMetaDataAccessor ( ) . getComponentMetaData ( ) ; if ( cmd == null ) { applicationName = getCDIAppName ( bun...
Get the j2ee name of the application . If the ComponentMetaData is available on the thread then that can be used otherwise fallback to asking the CDIService for the name ... the CDI context ID is the same as the j2ee name .
25,289
public static BundleContext getBundleContext ( Class < ? > clazz ) { BundleContext context = null ; if ( FrameworkState . isValid ( ) ) { Bundle bundle = FrameworkUtil . getBundle ( clazz ) ; if ( bundle != null ) { context = bundle . getBundleContext ( ) ; } } return context ; }
Get the OSGi bundle context for the given class
25,290
public static < T > T getService ( BundleContext bundleContext , Class < T > serviceClass ) { T service = null ; if ( FrameworkState . isValid ( ) ) { ServiceReference < T > ref = bundleContext . getServiceReference ( serviceClass ) ; if ( ref != null ) { service = bundleContext . getService ( ref ) ; } } return servic...
Find a service of the given type
25,291
public static ServiceReference < Application > getApplicationServiceRef ( BundleContext bundleContext , String applicationName ) { ServiceReference < Application > appRef = null ; if ( FrameworkState . isValid ( ) ) { Collection < ServiceReference < Application > > appRefs ; try { appRefs = bundleContext . getServiceRe...
Get the Application ServiceReferences which has the given name or null if not found
25,292
public static String getApplicationPID ( BundleContext bundleContext , String applicationName ) { String applicationPID = null ; if ( FrameworkState . isValid ( ) ) { ServiceReference < ? > appRef = getApplicationServiceRef ( bundleContext , applicationName ) ; if ( appRef != null ) { applicationPID = ( String ) appRef...
Get the internal OSGi identifier for the Application with the given name
25,293
public static String getCDIAppName ( BundleContext bundleContext ) { String appName = null ; if ( FrameworkState . isValid ( ) ) { CDIService cdiService = getCDIService ( bundleContext ) ; if ( cdiService != null ) { appName = cdiService . getCurrentApplicationContextID ( ) ; } } return appName ; }
Get the current application name using the CDIService . During CDI startup the CDIService knows which application it is currently working with so we can ask it!
25,294
public static boolean isSystemKey ( String key ) { for ( String prefix : Config13Constants . SYSTEM_PREFIXES ) { if ( key . startsWith ( prefix ) ) { return true ; } } return false ; }
Test to see if the given configuration key starts with any known system prefixes
25,295
protected final void traceChannels ( Object logTool , ChannelFramework cfw , String message , String prefix ) { if ( cfw == null ) { debugTrace ( logTool , prefix + " - No cfw to trace channels" ) ; return ; } List < ? > lchannel ; Iterator < ? > ichannel ; ChannelData channel ; ChannelData [ ] channelList ; StringBuil...
Print channel configuration - for debug
25,296
@ Generated ( value = "com.ibm.jtc.jax.tools.xjc.Driver" , date = "2014-06-11T05:49:00-04:00" , comments = "JAXB RI v2.2.3-11/28/2011 06:21 AM(foreman)-" ) public List < TransitionElement > getTransitionElements ( ) { if ( transitionElements == null ) { transitionElements = new ArrayList < TransitionElement > ( ) ; } r...
Gets the value of the transitionElements property .
25,297
public synchronized void refresh ( ApplicationMonitorConfig config ) { if ( config != null && config . isDropinsMonitored ( ) ) { _config . set ( config ) ; File previousMonitoredDirectory = null ; boolean createdPreviousDirectory = createdMonitoredDir . get ( ) ; String newMonitoredFolder = config . getLocation ( ) ; ...
Initialize the dropins manager based on configured properties
25,298
public synchronized void stop ( ) { _coreMonitor . unregister ( ) ; for ( ServiceReg < FileMonitor > reg : _monitors . values ( ) ) { reg . unregister ( ) ; } _monitors . clear ( ) ; tidyUpMonitoredDirectory ( createdMonitoredDir . get ( ) , monitoredDirectory . get ( ) ) ; }
Stops the service and all applications started by it
25,299
private void stopApplication ( File currentFile ) { if ( _tc . isEventEnabled ( ) ) { Tr . event ( _tc , "Stopping dropin application '" + currentFile . getName ( ) + "'" ) ; } String filePath = getAppLocation ( currentFile ) ; try { Configuration config = _configs . remove ( filePath ) ; if ( config != null ) { config...
Takes a file and a pid and will stop the file with that PID from running and remove the pid to app mapping from the app pid mapper