idx
int64
0
41.2k
question
stringlengths
83
4.15k
target
stringlengths
5
715
16,300
void wakeOut ( ) { OnAvailable outFlow = _outFlow ; if ( outFlow == null ) { return ; } if ( _creditsIn <= _queue . head ( ) ) { return ; } StateOutPipe stateOld ; StateOutPipe stateNew ; do { stateOld = _stateOutRef . get ( ) ; if ( ! stateOld . isFull ( ) ) { return ; } stateNew = stateOld . toWake ( ) ; } while ( ! ...
Notify the reader of available space in the pipe . If the writer is asleep wake it .
16,301
public void flush ( ) { int level = getLevel ( ) . intValue ( ) ; for ( int i = 0 ; i < _handlers . length ; i ++ ) { Handler handler = _handlers [ i ] ; if ( level <= handler . getLevel ( ) . intValue ( ) ) handler . flush ( ) ; } }
Flush the handler .
16,302
public void checkpointStart ( ) { if ( _isWhileCheckpoint ) { throw new IllegalStateException ( ) ; } _isWhileCheckpoint = true ; long sequence = ++ _sequence ; setSequence ( sequence ) ; byte [ ] headerBuffer = _headerBuffer ; BitsUtil . writeInt16 ( headerBuffer , 0 , CHECKPOINT_START ) ; writeImpl ( headerBuffer , 0...
Starts checkpoint processing . A checkpoint start changes the epoch ID for new journal entries but does not yet close the previous epoch .
16,303
public void checkpointEnd ( ) { if ( ! _isWhileCheckpoint ) { throw new IllegalStateException ( ) ; } _isWhileCheckpoint = false ; byte [ ] headerBuffer = _headerBuffer ; BitsUtil . writeInt16 ( headerBuffer , 0 , CHECKPOINT_END ) ; writeImpl ( headerBuffer , 0 , 2 ) ; flush ( ) ; _lastCheckpointEnd = _index - _startAd...
Closes the previous epoch . Journal entries in a closed epoch will not be replayed on a journal restore .
16,304
public void replay ( ReplayCallback replayCallback ) { TempBuffer tReadBuffer = TempBuffer . createLarge ( ) ; byte [ ] readBuffer = tReadBuffer . buffer ( ) ; int bufferLength = readBuffer . length ; try ( InStore jIn = _blockStore . openRead ( _startAddress , getSegmentSize ( ) ) ) { Replay replay = readReplay ( jIn ...
Replays all open journal entries . The journal entry will call into the callback listener with an open InputStream to read the entry .
16,305
private long scanItem ( InStore is , long address , byte [ ] readBuffer , byte [ ] tempBuffer ) { startRead ( ) ; byte [ ] headerBuffer = _headerBuffer ; while ( address + 2 < _tailAddress ) { readImpl ( is , address , readBuffer , headerBuffer , 0 , 2 ) ; address += 2 ; int len = BitsUtil . readInt16 ( headerBuffer , ...
Validates that the item is complete and correct .
16,306
public static void main ( String [ ] argv ) { EnvLoader . init ( ) ; ArgsServerBase args = new ArgsServerBaratine ( argv ) ; args . doMain ( ) ; }
The main start of the web server .
16,307
public int getLine ( ) { if ( _line >= 0 ) return _line ; Attribute attr = getAttribute ( "LineNumberTable" ) ; if ( attr == null ) { _line = 0 ; return _line ; } _line = 0 ; return _line ; }
Returns the line number .
16,308
public JClass getReturnType ( ) { String descriptor = getDescriptor ( ) ; int i = descriptor . lastIndexOf ( ')' ) ; return getClassLoader ( ) . descriptorToClass ( descriptor , i + 1 ) ; }
Returns the return types .
16,309
public Attribute removeAttribute ( String name ) { for ( int i = _attributes . size ( ) - 1 ; i >= 0 ; i -- ) { Attribute attr = _attributes . get ( i ) ; if ( attr . getName ( ) . equals ( name ) ) { _attributes . remove ( i ) ; return attr ; } } return null ; }
Removes an attribute .
16,310
public CodeAttribute getCode ( ) { for ( int i = 0 ; i < _attributes . size ( ) ; i ++ ) { Attribute attr = _attributes . get ( i ) ; if ( attr instanceof CodeAttribute ) return ( CodeAttribute ) attr ; } return null ; }
Returns the code attribute .
16,311
public CodeAttribute createCode ( ) { CodeAttribute code = new CodeAttribute ( ) ; for ( int i = 0 ; i < _attributes . size ( ) ; i ++ ) { Attribute attr = _attributes . get ( i ) ; if ( attr instanceof CodeAttribute ) return ( CodeAttribute ) attr ; } return null ; }
Create the code attribute .
16,312
public JavaMethod export ( JavaClass source , JavaClass target ) { JavaMethod method = new JavaMethod ( _loader ) ; method . setName ( _name ) ; method . setDescriptor ( _descriptor ) ; method . setAccessFlags ( _accessFlags ) ; target . getConstantPool ( ) . addUTF8 ( _name ) ; target . getConstantPool ( ) . addUTF8 (...
exports the method .
16,313
public void concatenate ( JavaMethod tail ) { CodeAttribute codeAttr = getCode ( ) ; CodeAttribute tailCodeAttr = tail . getCode ( ) ; byte [ ] code = codeAttr . getCode ( ) ; byte [ ] tailCode = tailCodeAttr . getCode ( ) ; int codeLength = code . length ; if ( ( code [ codeLength - 1 ] & 0xff ) == CodeVisitor . RETUR...
Concatenates the method .
16,314
public PodAppHandle getPodAppHandle ( String id ) { PodAppHandle handle = _podAppHandleMap . get ( id ) ; if ( handle == null ) { _podAppHandleMap . putIfAbsent ( id , handle ) ; } return handle ; }
Returns a handle to the PodApp service specified by the pod - app id .
16,315
public boolean stop ( ShutdownModeAmp mode ) { Objects . requireNonNull ( mode ) ; if ( ! _lifecycle . toStop ( ) ) { return false ; } _shutdownMode = mode ; return true ; }
Closes the container .
16,316
@ SuppressWarnings ( "unchecked" ) public final E remove ( ) { Thread thread = Thread . currentThread ( ) ; ClassLoader loader = thread . getContextClassLoader ( ) ; for ( ; loader != null ; loader = loader . getParent ( ) ) { if ( loader instanceof EnvironmentClassLoader ) { EnvironmentClassLoader envLoader = ( Enviro...
Removes this variable
16,317
@ SuppressWarnings ( "unchecked" ) public final E remove ( ClassLoader loader ) { for ( ; loader != null ; loader = loader . getParent ( ) ) { if ( loader instanceof EnvironmentClassLoader ) { EnvironmentClassLoader envLoader = ( EnvironmentClassLoader ) loader ; return ( E ) envLoader . removeAttribute ( _varName ) ; ...
Removes the variable for the context classloader .
16,318
public E setGlobal ( E value ) { E oldValue = _globalValue ; _globalValue = value ; ClassLoader systemLoader = getSystemClassLoader ( ) ; if ( systemLoader instanceof EnvironmentClassLoader ) ( ( EnvironmentClassLoader ) systemLoader ) . setAttribute ( _varName , value ) ; else _globalValue = value ; return oldValue ; ...
Sets the global value .
16,319
@ SuppressWarnings ( "unchecked" ) public E getGlobal ( ) { ClassLoader systemLoader = getSystemClassLoader ( ) ; if ( systemLoader instanceof EnvironmentClassLoader ) return ( E ) ( ( EnvironmentClassLoader ) systemLoader ) . getAttribute ( _varName ) ; else return _globalValue ; }
Returns the global value .
16,320
public String getSimpleName ( ) { String name = getName ( ) ; int p = name . lastIndexOf ( '.' ) ; return name . substring ( p + 1 ) ; }
Returns the class name .
16,321
public Class getJavaClass ( ) { try { ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; return Class . forName ( getName ( ) , false , loader ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } }
Returns the Java class .
16,322
public JMethod getConstructor ( JClass [ ] param ) { JMethod [ ] ctors = getConstructors ( ) ; loop : for ( int i = 0 ; i < ctors . length ; i ++ ) { JClass [ ] args = ctors [ i ] . getParameterTypes ( ) ; if ( args . length != param . length ) continue loop ; for ( int j = 0 ; j < args . length ; j ++ ) if ( ! args [ ...
Returns a matching constructor .
16,323
public String getShortName ( ) { if ( isArray ( ) ) return getComponentType ( ) . getShortName ( ) + "[]" ; else { String name = getName ( ) . replace ( '$' , '.' ) ; int p = name . lastIndexOf ( '.' ) ; if ( p >= 0 ) return name . substring ( p + 1 ) ; else return name ; } }
Returns a printable version of a class .
16,324
public void dispatch ( ) { Result < InputStreamClient > result = _result ; if ( result != null ) { result . ok ( _is ) ; } }
dispatch a request after the headers are read .
16,325
public void init ( boolean isSecure , CharSequence host , int port , byte [ ] uri , int uriLength ) { _isSecure = isSecure ; _host = host ; _port = port ; _uri = uri ; _uriLength = uriLength ; }
Initialize the InvocationKey with a new triple .
16,326
public HashMap < String , Object > getValueMap ( ) { try { if ( _values == null ) { _values = new HashMap < String , Object > ( ) ; Method [ ] methods = _ann . annotationType ( ) . getMethods ( ) ; for ( int i = 0 ; i < methods . length ; i ++ ) { Method method = methods [ i ] ; if ( method . getDeclaringClass ( ) . eq...
Returns the annotation values .
16,327
public JavaClass parse ( InputStream is ) throws IOException { _is = is ; if ( _loader == null ) _loader = new JavaClassLoader ( ) ; if ( _class == null ) _class = new JavaClass ( _loader ) ; _cp = _class . getConstantPool ( ) ; parseClass ( ) ; return _class ; }
Parses the . class file .
16,328
private void parseClass ( ) throws IOException { int magic = readInt ( ) ; if ( magic != JavaClass . MAGIC ) throw error ( L . l ( "bad magic number in class file" ) ) ; int minor = readShort ( ) ; int major = readShort ( ) ; _class . setMajor ( major ) ; _class . setMinor ( minor ) ; parseConstantPool ( ) ; int access...
Parses the ClassFile construct
16,329
private ConstantPoolEntry parseConstantPoolEntry ( int index ) throws IOException { int tag = read ( ) ; switch ( tag ) { case CP_CLASS : return parseClassConstant ( index ) ; case CP_FIELD_REF : return parseFieldRefConstant ( index ) ; case CP_METHOD_REF : return parseMethodRefConstant ( index ) ; case CP_INTERFACE_ME...
Parses a constant pool entry .
16,330
private ClassConstant parseClassConstant ( int index ) throws IOException { int nameIndex = readShort ( ) ; return new ClassConstant ( _class . getConstantPool ( ) , index , nameIndex ) ; }
Parses a class constant pool entry .
16,331
private FieldRefConstant parseFieldRefConstant ( int index ) throws IOException { int classIndex = readShort ( ) ; int nameAndTypeIndex = readShort ( ) ; return new FieldRefConstant ( _class . getConstantPool ( ) , index , classIndex , nameAndTypeIndex ) ; }
Parses a field ref constant pool entry .
16,332
private MethodRefConstant parseMethodRefConstant ( int index ) throws IOException { int classIndex = readShort ( ) ; int nameAndTypeIndex = readShort ( ) ; return new MethodRefConstant ( _class . getConstantPool ( ) , index , classIndex , nameAndTypeIndex ) ; }
Parses a method ref constant pool entry .
16,333
private InterfaceMethodRefConstant parseInterfaceMethodRefConstant ( int index ) throws IOException { int classIndex = readShort ( ) ; int nameAndTypeIndex = readShort ( ) ; return new InterfaceMethodRefConstant ( _class . getConstantPool ( ) , index , classIndex , nameAndTypeIndex ) ; }
Parses an interface method ref constant pool entry .
16,334
private StringConstant parseStringConstant ( int index ) throws IOException { int stringIndex = readShort ( ) ; return new StringConstant ( _class . getConstantPool ( ) , index , stringIndex ) ; }
Parses a string constant pool entry .
16,335
private IntegerConstant parseIntegerConstant ( int index ) throws IOException { int value = readInt ( ) ; return new IntegerConstant ( _class . getConstantPool ( ) , index , value ) ; }
Parses an integer constant pool entry .
16,336
private FloatConstant parseFloatConstant ( int index ) throws IOException { int bits = readInt ( ) ; float value = Float . intBitsToFloat ( bits ) ; return new FloatConstant ( _class . getConstantPool ( ) , index , value ) ; }
Parses a float constant pool entry .
16,337
private LongConstant parseLongConstant ( int index ) throws IOException { long value = readLong ( ) ; return new LongConstant ( _class . getConstantPool ( ) , index , value ) ; }
Parses a long constant pool entry .
16,338
private DoubleConstant parseDoubleConstant ( int index ) throws IOException { long bits = readLong ( ) ; double value = Double . longBitsToDouble ( bits ) ; return new DoubleConstant ( _class . getConstantPool ( ) , index , value ) ; }
Parses a double constant pool entry .
16,339
private NameAndTypeConstant parseNameAndTypeConstant ( int index ) throws IOException { int nameIndex = readShort ( ) ; int descriptorIndex = readShort ( ) ; return new NameAndTypeConstant ( _class . getConstantPool ( ) , index , nameIndex , descriptorIndex ) ; }
Parses a name and type pool entry .
16,340
private Utf8Constant parseUtf8Constant ( int index ) throws IOException { int length = readShort ( ) ; StringBuilder cb = new StringBuilder ( ) ; for ( int i = 0 ; i < length ; i ++ ) { int ch = read ( ) ; if ( ch < 0x80 ) { cb . append ( ( char ) ch ) ; } else if ( ( ch & 0xe0 ) == 0xc0 ) { int ch2 = read ( ) ; i ++ ;...
Parses a utf - 8 constant pool entry .
16,341
private void parseMethod ( ) throws IOException { int accessFlags = readShort ( ) ; int nameIndex = readShort ( ) ; int descriptorIndex = readShort ( ) ; JavaMethod method = new JavaMethod ( _loader ) ; method . setJavaClass ( _class ) ; method . setName ( _cp . getUtf8 ( nameIndex ) . getValue ( ) ) ; method . setDesc...
Parses a method entry .
16,342
public Attribute parseAttribute ( ) throws IOException { int nameIndex = readShort ( ) ; String name = _cp . getUtf8 ( nameIndex ) . getValue ( ) ; if ( name . equals ( "Code" ) ) { CodeAttribute code = new CodeAttribute ( name ) ; code . read ( this ) ; return code ; } else if ( name . equals ( "Exceptions" ) ) { Exce...
Parses an attribute .
16,343
long readLong ( ) throws IOException { return ( ( ( long ) _is . read ( ) << 56 ) | ( ( long ) _is . read ( ) << 48 ) | ( ( long ) _is . read ( ) << 40 ) | ( ( long ) _is . read ( ) << 32 ) | ( ( long ) _is . read ( ) << 24 ) | ( ( long ) _is . read ( ) << 16 ) | ( ( long ) _is . read ( ) << 8 ) | ( ( long ) _is . read...
Parses a 64 - bit int .
16,344
public int readInt ( ) throws IOException { return ( ( _is . read ( ) << 24 ) | ( _is . read ( ) << 16 ) | ( _is . read ( ) << 8 ) | ( _is . read ( ) ) ) ; }
Parses a 32 - bit int .
16,345
public int read ( byte [ ] buffer , int offset , int length ) throws IOException { int readLength = 0 ; while ( length > 0 ) { int sublen = _is . read ( buffer , offset , length ) ; if ( sublen < 0 ) return readLength == 0 ? - 1 : readLength ; offset += sublen ; length -= sublen ; readLength += sublen ; } return readLe...
Reads a chunk
16,346
public void start ( ) { try { JournalClientEndpoint endpoint = connect ( ) ; if ( endpoint != null ) { OutputStream os ; _os = os = endpoint . startMessage ( ) ; if ( os != null ) { os . write ( 'M' ) ; } } } catch ( Exception e ) { log . finer ( e . toString ( ) ) ; } }
Start a journalled message .
16,347
public void write ( byte [ ] buffer , int offset , int length ) { try { OutputStream os = _os ; if ( os != null ) { os . write ( buffer , offset , length ) ; } } catch ( Exception e ) { log . log ( Level . FINER , e . toString ( ) , e ) ; } }
write the contents of a journal message .
16,348
public boolean complete ( ) { OutputStream os = _os ; _os = null ; IoUtil . close ( os ) ; return true ; }
Complete a journaled message .
16,349
private static void printStackTraceElement ( StackTraceElement trace , PrintWriter out , ClassLoader loader ) { try { LineMap map = getScriptLineMap ( trace . getClassName ( ) , loader ) ; if ( map != null ) { LineMap . Line line = map . getLine ( trace . getLineNumber ( ) ) ; if ( line != null ) { out . print ( trace ...
Prints a single stack trace element .
16,350
public static LineMap getScriptLineMap ( String className , ClassLoader loader ) { try { Class cl = loader . loadClass ( className ) ; LineMap map = _scriptMap . get ( cl ) ; if ( map == null ) { map = loadScriptMap ( cl ) ; _scriptMap . put ( cl , map ) ; } return map ; } catch ( Throwable e ) { return null ; } }
Loads the local line map for a class .
16,351
private static LineMap loadScriptMap ( Class cl ) { ClassLoader loader = cl . getClassLoader ( ) ; if ( loader == null ) return new LineMap ( ) ; try { String pathName = cl . getName ( ) . replace ( '.' , '/' ) + ".class" ; InputStream is = loader . getResourceAsStream ( pathName ) ; if ( is == null ) return null ; try...
Loads the script map for a class
16,352
private List < IPolicy > getPoliciesOrDefault ( final IGuaranteeTerm term ) { if ( term . getPolicies ( ) != null && term . getPolicies ( ) . size ( ) > 0 ) { return term . getPolicies ( ) ; } return Collections . singletonList ( defaultPolicy ) ; }
Return policies of the term if any or the default policy .
16,353
protected final void doStart ( Collection < ? extends Location > locations ) { ServiceStateLogic . setExpectedState ( this , Lifecycle . STARTING ) ; try { preStart ( ) ; driver . start ( ) ; log . info ( "Entity {} was started with driver {}" , new Object [ ] { this , driver } ) ; postDriverStart ( ) ; connectSensors ...
It is a temporal method . It will be contains the start effector body . It will be moved to LifeCycle class based on Task . It is the first approach . It does not start the entity children .
16,354
private DNode findFrontendNode ( ) { DNode frontend = getNode ( requirements . getFrontend ( ) ) ; if ( frontend == DNode . NOT_FOUND ) { frontend = searchFrontendNode ( ) ; if ( frontend == DNode . NOT_FOUND ) { frontend = calculateSourceNode ( ) ; } } return frontend ; }
Assigns a frontend node to the graph according to the rules in the class header
16,355
private DNode searchFrontendNode ( ) { DNode result = DNode . NOT_FOUND ; for ( DNode node : nodes ) { if ( node . getFrontend ( ) ) { result = node ; break ; } } return result ; }
Searches the first node with frontend property set to true
16,356
private DNode calculateSourceNode ( ) { DNode result = DNode . NOT_FOUND ; for ( DNode node : nodes ) { List < DLink > links = getLinksTo ( node ) ; if ( links . size ( ) == 0 ) { result = node ; break ; } } return result ; }
Finds the first node with no incoming links .
16,357
public Reader create ( InputStream is ) throws UnsupportedEncodingException { Reader reader = create ( is , getJavaEncoding ( ) ) ; if ( reader != null ) return reader ; else return new ISO8859_1Reader ( is ) ; }
Returns a new encoding reader for the given stream and javaEncoding .
16,358
protected void initRequest ( ) { super . initRequest ( ) ; _uri . clear ( ) ; _host . clear ( ) ; _headerSize = 0 ; _remoteHost . clear ( ) ; _remoteAddr . clear ( ) ; _serverName . clear ( ) ; _serverPort . clear ( ) ; _remotePort . clear ( ) ; _clientCert . clear ( ) ; }
Clears variables at the start of a new request .
16,359
protected CharBuffer getHost ( ) { if ( _host . length ( ) > 0 ) { return _host ; } _host . append ( _serverName ) ; _host . toLowerCase ( ) ; return _host ; }
Returns a char buffer containing the host .
16,360
@ ConfigArg ( 0 ) public void setPath ( PathImpl path ) { if ( path . getPath ( ) . endsWith ( ".jar" ) || path . getPath ( ) . endsWith ( ".zip" ) ) { path = JarPath . create ( path ) ; } _path = path ; }
Sets the resource directory .
16,361
public void setPrefix ( String prefix ) { _prefix = prefix ; if ( prefix != null ) _pathPrefix = prefix . replace ( '.' , '/' ) ; }
Sets the resource prefix
16,362
public void init ( ) throws ConfigException { try { _codeSource = new CodeSource ( new URL ( _path . getURL ( ) ) , ( Certificate [ ] ) null ) ; } catch ( Exception e ) { log . log ( Level . FINE , e . toString ( ) , e ) ; } super . init ( ) ; getClassLoader ( ) . addURL ( _path , _isScanned ) ; }
Initializes the loader .
16,363
protected void buildClassPath ( ArrayList < String > pathList ) { String path = null ; if ( _path instanceof JarPath ) path = ( ( JarPath ) _path ) . getContainer ( ) . getNativePath ( ) ; else if ( _path . isDirectory ( ) ) path = _path . getNativePath ( ) ; if ( path != null && ! pathList . contains ( path ) ) pathLi...
Adds the class of this resource .
16,364
public void init ( ) throws Exception { if ( _encoding == null ) throw new ConfigException ( L . l ( "character-encoding requires a 'value' attribute with the character encoding." ) ) ; _localEncoding . set ( _encoding ) ; }
Initialize the resource .
16,365
public PathImpl schemeWalk ( String userPath , Map < String , Object > newAttributes , String uri , int offset ) { int length = uri . length ( ) ; if ( length < 2 + offset || uri . charAt ( offset ) != '/' || uri . charAt ( 1 + offset ) != '/' ) throw new RuntimeException ( "bad scheme" ) ; CharBuffer buf = new CharBuf...
Lookup the new path assuming we re the scheme root .
16,366
public int read ( byte [ ] buf , int offset , int length ) throws IOException { if ( _is == null ) return - 1 ; int len = _is . read ( buf , offset , length ) ; return len ; }
Reads bytes from the file .
16,367
public void close ( ) throws IOException { unlock ( ) ; _fileChannel = null ; InputStream is = _is ; _is = null ; if ( is != null ) is . close ( ) ; }
Closes the underlying stream .
16,368
public static OutboxAmp getOutboxCurrent ( ) { OutboxAmp outbox = OutboxAmp . current ( ) ; if ( outbox != null ) { return outbox ; } else { return OutboxAmpNull . NULL ; } }
Returns the calling outbox from the current context if available .
16,369
public void write ( ByteAppendable os , char ch ) throws IOException { os . write ( ch >> 8 ) ; os . write ( ch ) ; }
Writes the character using the correct encoding .
16,370
static JClassLoader getSystemClassLoader ( ) { if ( _staticClassLoader == null ) _staticClassLoader = JClassLoaderWrapper . create ( ClassLoader . getSystemClassLoader ( ) ) ; return _staticClassLoader ; }
Returns the wrapped system class loader .
16,371
public Offering fetchOffer ( String cloudOfferingId ) { if ( cloudOfferingId == null ) return null ; return offeringManager . getOffering ( cloudOfferingId ) ; }
Reads an offering from the local repository .
16,372
public String addOffering ( Offering newOffering ) { if ( newOffering == null ) return null ; String offeringName = newOffering . getName ( ) ; if ( offeringManager . getOffering ( offeringName ) != null ) { offeringManager . removeOffering ( offeringName ) ; } offeringManager . addOffering ( newOffering ) ; this . off...
Inserts or eventually updates an offering in the local repository
16,373
public void print ( int i ) { if ( i == 0x80000000 ) { print ( "-2147483648" ) ; return ; } if ( i < 0 ) { write ( '-' ) ; i = - i ; } else if ( i < 9 ) { write ( '0' + i ) ; return ; } int length = 0 ; int exp = 10 ; if ( i >= 1000000000 ) length = 9 ; else { for ( ; i >= exp ; length ++ ) exp = 10 * exp ; } int j = 3...
Prints an integer value .
16,374
public void print ( long v ) { if ( v == 0x8000000000000000L ) { print ( "-9223372036854775808" ) ; return ; } if ( v < 0 ) { write ( '-' ) ; v = - v ; } else if ( v == 0 ) { write ( '0' ) ; return ; } int j = 31 ; while ( v > 0 ) { _tempCharBuffer [ -- j ] = ( char ) ( ( v % 10 ) + '0' ) ; v /= 10 ; } write ( _tempCha...
Prints a long value .
16,375
final public void print ( Object v ) { if ( v == null ) write ( _nullChars , 0 , _nullChars . length ) ; else { String s = v . toString ( ) ; write ( s , 0 , s . length ( ) ) ; } }
Prints the value of the object .
16,376
final public void println ( float v ) { String s = String . valueOf ( v ) ; write ( s , 0 , s . length ( ) ) ; println ( ) ; }
Prints a float followed by a newline .
16,377
final public void println ( String s ) { if ( s == null ) write ( _nullChars , 0 , _nullChars . length ) ; else write ( s , 0 , s . length ( ) ) ; println ( ) ; }
Writes a string followed by a newline .
16,378
private void configureServer ( ServerBartender server ) { ServerNetwork serverNet = _serverMap . get ( server . getId ( ) ) ; if ( serverNet == null ) { serverNet = new ServerNetwork ( _system , server ) ; configServer ( serverNet , server ) ; serverNet . init ( ) ; _serverMap . put ( server . getId ( ) , serverNet ) ;...
Configures the server .
16,379
public JType [ ] getActualTypeArguments ( ) { Type [ ] rawArgs = _type . getActualTypeArguments ( ) ; JType [ ] args = new JType [ rawArgs . length ] ; for ( int i = 0 ; i < args . length ; i ++ ) { Type type = rawArgs [ i ] ; if ( type instanceof Class ) { args [ i ] = _loader . forName ( ( ( Class ) type ) . getName ...
Returns the actual type arguments .
16,380
public void close ( ) { if ( _isClosed ) { return ; } _isClosed = true ; KelpManager backing = _kelpBacking ; if ( backing != null ) { backing . close ( ) ; } }
Closes the manager .
16,381
public void map ( MethodRef method , String sql , Object [ ] args ) { QueryBuilderKraken builder = QueryParserKraken . parse ( this , sql ) ; if ( builder . isTableLoaded ( ) ) { QueryKraken query = builder . build ( ) ; query . map ( method , args ) ; } else { String tableName = builder . getTableName ( ) ; _tableServ...
Maps results to a method callback .
16,382
public static StderrStream create ( ) { if ( _stderr == null ) { _stderr = new StderrStream ( ) ; ConstPath path = new ConstPath ( null , _stderr ) ; path . setScheme ( "stderr" ) ; } return _stderr ; }
Returns the StderrStream singleton
16,383
public static long generate ( long hash , final CharSequence value ) { final long m = 0xc6a4a7935bd1e995L ; final int r = 47 ; int strlen = value . length ( ) ; int length = 2 * strlen ; hash ^= length * m ; int len4 = strlen / 4 ; int offset = 0 ; for ( int i = 0 ; i < len4 ; i ++ ) { final int index = i * 4 + offset ...
Calculates hash from a String using utf - 16 encoding
16,384
public static byte [ ] process ( CharSequence html ) { ByteArrayOutputStream baos = null ; try { baos = new ByteArrayOutputStream ( ) ; process ( html , baos ) ; return baos . toByteArray ( ) ; } finally { if ( baos != null ) { try { baos . close ( ) ; } catch ( IOException e ) { log . warn ( "Close Byte Array Inpout S...
process html to xls
16,385
public static void process ( CharSequence html , OutputStream output ) { new TableToXls ( ) . doProcess ( html instanceof String ? ( String ) html : html . toString ( ) , output ) ; }
process html to output stream
16,386
public void writeSend ( StubAmp actor , String methodName , Object [ ] args , InboxAmp inbox ) { try ( OutputStream os = openItem ( inbox ) ) { try ( OutH3 out = _serializer . out ( os ) ) { String key = actor . journalKey ( ) ; out . writeLong ( CODE_SEND ) ; out . writeString ( key ) ; out . writeString ( methodName ...
Writes the send to the journal . The queryRef values are not saved because restoring them does not make sense .
16,387
protected boolean addDependencies ( DependencyContainer container ) { if ( _hasJNIReload ) { container . add ( this ) ; return true ; } else if ( _sourcePath == null ) { container . add ( _depend ) ; return false ; } else { container . add ( this ) ; return true ; } }
Adds the dependencies returning true if it s adding itself .
16,388
public boolean reloadIsModified ( ) { if ( _classIsModified ) { return true ; } if ( ! _hasJNIReload || ! _classPath . canRead ( ) ) { return true ; } try { long length = _classPath . length ( ) ; Class < ? > cl = _clRef != null ? _clRef . get ( ) : null ; if ( cl == null ) { return false ; } byte [ ] bytecode = new by...
Returns true if the reload doesn t avoid the dependency .
16,389
public void load ( ByteArrayBuffer buffer ) throws IOException { synchronized ( this ) { Source classPath = getClassPath ( ) ; buffer . clear ( ) ; int retry = 3 ; for ( int i = 0 ; i < retry ; i ++ ) { long length = - 1 ; try ( InputStream is = classPath . inputStream ( ) ) { length = classPath . length ( ) ; long las...
Loads the contents of the class file into the buffer .
16,390
public static SystemManager getCurrent ( ) { SystemManager system = _systemLocal . get ( ) ; if ( system == null ) { WeakReference < SystemManager > globalRef = _globalSystemRef ; if ( globalRef != null ) { system = globalRef . get ( ) ; } } return system ; }
Returns the current server
16,391
public static < T extends SubSystem > T getCurrentSystem ( Class < T > systemClass ) { SystemManager manager = getCurrent ( ) ; if ( manager != null ) return manager . getSystem ( systemClass ) ; else return null ; }
Returns the current identified system .
16,392
public static String getCurrentId ( ) { SystemManager system = getCurrent ( ) ; if ( system == null ) { ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; throw new IllegalStateException ( L . l ( "{0} is not available in this context.\n {1}" , SystemManager . class . getSimpleName ( ) , loa...
Returns the current system id .
16,393
public < T extends SubSystem > T addSystemIfAbsent ( T system ) { return addSystemIfAbsent ( system . getClass ( ) , system ) ; }
Adds a new service .
16,394
@ SuppressWarnings ( "unchecked" ) public < T extends SubSystem > T getSystem ( Class < T > cl ) { return ( T ) _systemMap . get ( cl ) ; }
Returns the system for the given class .
16,395
private void stop ( ShutdownModeAmp mode ) { _shutdownMode = mode ; Thread thread = Thread . currentThread ( ) ; ClassLoader oldLoader = thread . getContextClassLoader ( ) ; try { thread . setContextClassLoader ( _classLoader ) ; if ( ! _lifecycle . toStopping ( ) ) { return ; } TreeSet < SubSystem > systems = new Tree...
stops the server .
16,396
public void shutdown ( ShutdownModeAmp mode ) { stop ( mode ) ; if ( ! _lifecycle . toDestroy ( ) ) { return ; } Thread thread = Thread . currentThread ( ) ; ClassLoader oldLoader = thread . getContextClassLoader ( ) ; try { thread . setContextClassLoader ( _classLoader ) ; TreeSet < SubSystem > systems = new TreeSet <...
Shuts down the server in the given mode .
16,397
public boolean addProperty ( String propertyName , String property ) { boolean ret = this . properties . containsKey ( propertyName ) ; this . properties . put ( propertyName , property ) ; return ret ; }
Used to add a new property to the offering
16,398
public static String sanitizeName ( String name ) { if ( name == null ) throw new NullPointerException ( "Parameter name cannot be null" ) ; name = name . trim ( ) ; if ( name . length ( ) == 0 ) throw new IllegalArgumentException ( "Parameter name cannot be empty" ) ; StringBuilder ret = new StringBuilder ( "" ) ; for...
Sanitizes a name by replacing every not alphanumeric character with _
16,399
public String getUtf8AsString ( int index ) { Utf8Constant utf8 = ( Utf8Constant ) _entries . get ( index ) ; if ( utf8 == null ) return null ; else return utf8 . getValue ( ) ; }
Returns a utf - 8 constant as a string