Java Code Examples for com.sun.corba.se.impl.orbutil.ORBConstants

The following examples show how to use com.sun.corba.se.impl.orbutil.ORBConstants. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
/**
 * Returns the correct buffer size for this type of
 * buffer manager as set in the ORB.
 */
public int getBufferSize() {
    ORBData orbData = null;
    int bufferSize = ORBConstants.GIOP_DEFAULT_BUFFER_SIZE;
    if (orb != null) {
        orbData = orb.getORBData();
        if (orbData != null) {
            bufferSize = orbData.getGIOPBufferSize();
            dprint("BufferManagerWriteGrow.getBufferSize: bufferSize == " + bufferSize);
        } else {
            dprint("BufferManagerWriteGrow.getBufferSize: orbData reference is NULL");
        }
    } else {
        dprint("BufferManagerWriteGrow.getBufferSize: orb reference is NULL");
    }
    return bufferSize;
}
 
Example 2
Source Project: openjdk-8-source   Source File: ORBD.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Ensure that the Db directory exists. If not, create the Db
 * and the log directory and return true. Otherwise return false.
 */
protected boolean createSystemDirs(String defaultDbDir)
{
    boolean dirCreated = false;
    Properties props = System.getProperties();
    String fileSep = props.getProperty("file.separator");

    // determine the ORB db directory
    dbDir = new File (props.getProperty( ORBConstants.DB_DIR_PROPERTY,
        props.getProperty("user.dir") + fileSep + defaultDbDir));

    // create the db and the logs directories
    dbDirName = dbDir.getAbsolutePath();
    props.put(ORBConstants.DB_DIR_PROPERTY, dbDirName);
    if (!dbDir.exists()) {
        dbDir.mkdir();
        dirCreated = true;
    }

    File logDir = new File (dbDir, ORBConstants.SERVER_LOG_DIR ) ;
    if (!logDir.exists()) logDir.mkdir();

    return dirCreated;
}
 
Example 3
Source Project: hottub   Source File: ORBD.java    License: GNU General Public License v2.0 6 votes vote down vote up
/**
 * Ensure that the Db directory exists. If not, create the Db
 * and the log directory and return true. Otherwise return false.
 */
protected boolean createSystemDirs(String defaultDbDir)
{
    boolean dirCreated = false;
    Properties props = System.getProperties();
    String fileSep = props.getProperty("file.separator");

    // determine the ORB db directory
    dbDir = new File (props.getProperty( ORBConstants.DB_DIR_PROPERTY,
        props.getProperty("user.dir") + fileSep + defaultDbDir));

    // create the db and the logs directories
    dbDirName = dbDir.getAbsolutePath();
    props.put(ORBConstants.DB_DIR_PROPERTY, dbDirName);
    if (!dbDir.exists()) {
        dbDir.mkdir();
        dirCreated = true;
    }

    File logDir = new File (dbDir, ORBConstants.SERVER_LOG_DIR ) ;
    if (!logDir.exists()) logDir.mkdir();

    return dirCreated;
}
 
Example 4
private byte getStreamFormatVersionForThisRequest(IOR ior,
                                                  GIOPVersion giopVersion)
{

    byte localMaxVersion
        = ORBUtility.getMaxStreamFormatVersion();

    IOR effectiveTargetIOR =
        ((CorbaContactInfo)this.contactInfo).getEffectiveTargetIOR();
    IIOPProfileTemplate temp =
        (IIOPProfileTemplate)effectiveTargetIOR.getProfile().getTaggedProfileTemplate();
    Iterator iter = temp.iteratorById(TAG_RMI_CUSTOM_MAX_STREAM_FORMAT.value);
    if (!iter.hasNext()) {
        // Didn't have the max stream format version tagged
        // component.
        if (giopVersion.lessThan(GIOPVersion.V1_3))
            return ORBConstants.STREAM_FORMAT_VERSION_1;
        else
            return ORBConstants.STREAM_FORMAT_VERSION_2;
    }

    byte remoteMaxVersion
        = ((MaxStreamFormatVersionComponent)iter.next()).getMaxStreamFormatVersion();

    return (byte)Math.min(localMaxVersion, remoteMaxVersion);
}
 
Example 5
public DataCollectorBase( Properties props, String localHostName,
    String configurationHostName )
{
    // XXX This is fully initialized here.  So do we ever want to
    // generalize this (or perhaps this is the wrong place for this?)
    URLPropertyNames = new HashSet() ;
    URLPropertyNames.add( ORBConstants.INITIAL_SERVICES_PROPERTY ) ;

    propertyNames = new HashSet() ;

    // Make sure that we are ready to handle -ORBInitRef.  This is special
    // due to the need to handle multiple -ORBInitRef args as prefix
    // parsing.
    propertyNames.add( ORBConstants.ORB_INIT_REF_PROPERTY ) ;

    propertyPrefixes = new HashSet() ;

    this.originalProps = props ;
    this.localHostName = localHostName ;
    this.configurationHostName = configurationHostName ;
    setParserCalled = false ;
    resultProps = new Properties() ;
}
 
Example 6
Source Project: jdk1.8-source-analysis   Source File: ORBD.java    License: Apache License 2.0 6 votes vote down vote up
protected ORB createORB(String[] args)
{
    Properties props = System.getProperties();

    // For debugging.
    //props.put( ORBConstants.DEBUG_PROPERTY, "naming" ) ;
    //props.put( ORBConstants.DEBUG_PROPERTY, "transport,giop,naming" ) ;

    props.put( ORBConstants.SERVER_ID_PROPERTY, "1000" ) ;
    props.put( ORBConstants.PERSISTENT_SERVER_PORT_PROPERTY,
        props.getProperty( ORBConstants.ORBD_PORT_PROPERTY,
            Integer.toString(
                ORBConstants.DEFAULT_ACTIVATION_PORT ) ) ) ;

    // See Bug 4396928 for more information about why we are initializing
    // the ORBClass to PIORB (now ORBImpl, but should check the bugid).
    props.put("org.omg.CORBA.ORBClass",
        "com.sun.corba.se.impl.orb.ORBImpl");

    return (ORB) ORB.init(args, props);
}
 
Example 7
Source Project: openjdk-8-source   Source File: NameServer.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected void run()
{
    try {

        // create the persistent name service
        NameService ns = new NameService(orb, dbDir);

        // add root naming context to initial naming
        NamingContext rootContext = ns.initialNamingContext();
        InitialNameService ins = InitialNameServiceHelper.narrow(
                                 orb.resolve_initial_references(
                                 ORBConstants.INITIAL_NAME_SERVICE_NAME ));
        ins.bind( "NameService", rootContext, true);
        System.out.println(CorbaResourceUtil.getText("pnameserv.success"));

        // wait for invocations
        orb.run();

    } catch (Exception ex) {

        ex.printStackTrace(System.err);
    }
}
 
Example 8
private CDROutputObject createAppropriateOutputObject(
    CorbaMessageMediator messageMediator,
    Message msg, LocateReplyMessage reply)
{
    CDROutputObject outputObject;

    if (msg.getGIOPVersion().lessThan(GIOPVersion.V1_2)) {
        // locate msgs 1.0 & 1.1 :=> grow,
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         this,
                         GIOPVersion.V1_0,
                         (CorbaConnection) messageMediator.getConnection(),
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    } else {
        // 1.2 :=> stream
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         messageMediator,
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    }
    return outputObject;
}
 
Example 9
private CDROutputObject createAppropriateOutputObject(
    CorbaMessageMediator messageMediator,
    Message msg, LocateReplyMessage reply)
{
    CDROutputObject outputObject;

    if (msg.getGIOPVersion().lessThan(GIOPVersion.V1_2)) {
        // locate msgs 1.0 & 1.1 :=> grow,
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         this,
                         GIOPVersion.V1_0,
                         (CorbaConnection) messageMediator.getConnection(),
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    } else {
        // 1.2 :=> stream
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         messageMediator,
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    }
    return outputObject;
}
 
Example 10
private CDROutputObject createAppropriateOutputObject(
    CorbaMessageMediator messageMediator,
    Message msg, LocateReplyMessage reply)
{
    CDROutputObject outputObject;

    if (msg.getGIOPVersion().lessThan(GIOPVersion.V1_2)) {
        // locate msgs 1.0 & 1.1 :=> grow,
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         this,
                         GIOPVersion.V1_0,
                         (CorbaConnection) messageMediator.getConnection(),
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    } else {
        // 1.2 :=> stream
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         messageMediator,
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    }
    return outputObject;
}
 
Example 11
private void setProperty( String name, String value )
{
    if( name.equals( ORBConstants.ORB_INIT_REF_PROPERTY ) ) {
        // Value is <name>=<URL>
        StringTokenizer st = new StringTokenizer( value, "=" ) ;
        if (st.countTokens() != 2)
            throw new IllegalArgumentException() ;

        String refName = st.nextToken() ;
        String refValue = st.nextToken() ;

        resultProps.setProperty( name + "." + refName, refValue ) ;
    } else {
        resultProps.setProperty( name, value ) ;
    }
}
 
Example 12
Source Project: jdk1.8-source-analysis   Source File: NamingContextImpl.java    License: Apache License 2.0 6 votes vote down vote up
private synchronized void createbiPOA( ) {
    if( biPOA != null ) {
        return;
    }
    try {
        POA rootPOA = (POA) orb.resolve_initial_references(
            ORBConstants.ROOT_POA_NAME );
        rootPOA.the_POAManager().activate( );

        int i = 0;
        Policy[] poaPolicy = new Policy[3];
        poaPolicy[i++] = rootPOA.create_lifespan_policy(
            LifespanPolicyValue.TRANSIENT);
        poaPolicy[i++] = rootPOA.create_id_assignment_policy(
            IdAssignmentPolicyValue.SYSTEM_ID);
        poaPolicy[i++] = rootPOA.create_servant_retention_policy(
            ServantRetentionPolicyValue.RETAIN);
        biPOA = rootPOA.create_POA("BindingIteratorPOA", null, poaPolicy );
        biPOA.the_POAManager().activate( );
    } catch( Exception e ) {
        throw readWrapper.namingCtxBindingIteratorCreate( e ) ;
    }
}
 
Example 13
/**
 * If the RMI-IIOP maximum stream format version service context
 * is present, it indicates the maximum stream format version we
 * could use for the reply.  If it isn't present, the default is
 * 2 for GIOP 1.3 or greater, 1 for lower.
 *
 * This is only sent on requests.  Clients can find out the
 * server's maximum by looking for a tagged component in the IOR.
 */
public byte getStreamFormatVersionForReply() {

    // NOTE: The request service contexts may indicate the max.
    ServiceContexts svc = getRequestServiceContexts();

    MaxStreamFormatVersionServiceContext msfvsc
        = (MaxStreamFormatVersionServiceContext)svc.get(
            MaxStreamFormatVersionServiceContext.SERVICE_CONTEXT_ID);

    if (msfvsc != null) {
        byte localMaxVersion = ORBUtility.getMaxStreamFormatVersion();
        byte remoteMaxVersion = msfvsc.getMaximumStreamFormatVersion();

        return (byte)Math.min(localMaxVersion, remoteMaxVersion);
    } else {
        // Defaults to 1 for GIOP 1.2 or less, 2 for
        // GIOP 1.3 or higher.
        if (getGIOPVersion().lessThan(GIOPVersion.V1_3))
            return ORBConstants.STREAM_FORMAT_VERSION_1;
        else
            return ORBConstants.STREAM_FORMAT_VERSION_2;
    }
}
 
Example 14
private CDROutputObject createAppropriateOutputObject(
    CorbaMessageMediator messageMediator,
    Message msg, LocateReplyMessage reply)
{
    CDROutputObject outputObject;

    if (msg.getGIOPVersion().lessThan(GIOPVersion.V1_2)) {
        // locate msgs 1.0 & 1.1 :=> grow,
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         this,
                         GIOPVersion.V1_0,
                         (CorbaConnection) messageMediator.getConnection(),
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    } else {
        // 1.2 :=> stream
        outputObject = sun.corba.OutputStreamFactory.newCDROutputObject(
                         (ORB) messageMediator.getBroker(),
                         messageMediator,
                         reply,
                         ORBConstants.STREAM_FORMAT_VERSION_1);
    }
    return outputObject;
}
 
Example 15
Source Project: openjdk-8-source   Source File: IORImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
public String stringify()
{
    StringWriter bs;

    MarshalOutputStream s =
        sun.corba.OutputStreamFactory.newEncapsOutputStream(factory);
    s.putEndian();
    write( (OutputStream)s );
    bs = new StringWriter();
    try {
        s.writeTo(new HexOutputStream(bs));
    } catch (IOException ex) {
        throw wrapper.stringifyWriteError( ex ) ;
    }

    return ORBConstants.STRINGIFY_PREFIX + bs;
}
 
Example 16
Source Project: openjdk-jdk8u   Source File: POAFactory.java    License: GNU General Public License v2.0 6 votes vote down vote up
public synchronized POA getRootPOA()
{
    if (rootPOA == null) {
        // See if we are trying to getRootPOA while shutting down the ORB.
        if (isShuttingDown) {
            throw omgWrapper.noObjectAdaptor( ) ;
        }

        try {
            Object obj = orb.resolve_initial_references(
                ORBConstants.ROOT_POA_NAME ) ;
            rootPOA = (POAImpl)obj ;
        } catch (InvalidName inv) {
            throw wrapper.cantResolveRootPoa( inv ) ;
        }
    }

    return rootPOA;
}
 
Example 17
/**
 * If the RMI-IIOP maximum stream format version service context
 * is present, it indicates the maximum stream format version we
 * could use for the reply.  If it isn't present, the default is
 * 2 for GIOP 1.3 or greater, 1 for lower.
 *
 * This is only sent on requests.  Clients can find out the
 * server's maximum by looking for a tagged component in the IOR.
 */
public byte getStreamFormatVersionForReply() {

    // NOTE: The request service contexts may indicate the max.
    ServiceContexts svc = getRequestServiceContexts();

    MaxStreamFormatVersionServiceContext msfvsc
        = (MaxStreamFormatVersionServiceContext)svc.get(
            MaxStreamFormatVersionServiceContext.SERVICE_CONTEXT_ID);

    if (msfvsc != null) {
        byte localMaxVersion = ORBUtility.getMaxStreamFormatVersion();
        byte remoteMaxVersion = msfvsc.getMaximumStreamFormatVersion();

        return (byte)Math.min(localMaxVersion, remoteMaxVersion);
    } else {
        // Defaults to 1 for GIOP 1.2 or less, 2 for
        // GIOP 1.3 or higher.
        if (getGIOPVersion().lessThan(GIOPVersion.V1_3))
            return ORBConstants.STREAM_FORMAT_VERSION_1;
        else
            return ORBConstants.STREAM_FORMAT_VERSION_2;
    }
}
 
Example 18
Source Project: TencentKona-8   Source File: ORBD.java    License: GNU General Public License v2.0 6 votes vote down vote up
protected ORB createORB(String[] args)
{
    Properties props = System.getProperties();

    // For debugging.
    //props.put( ORBConstants.DEBUG_PROPERTY, "naming" ) ;
    //props.put( ORBConstants.DEBUG_PROPERTY, "transport,giop,naming" ) ;

    props.put( ORBConstants.SERVER_ID_PROPERTY, "1000" ) ;
    props.put( ORBConstants.PERSISTENT_SERVER_PORT_PROPERTY,
        props.getProperty( ORBConstants.ORBD_PORT_PROPERTY,
            Integer.toString(
                ORBConstants.DEFAULT_ACTIVATION_PORT ) ) ) ;

    // See Bug 4396928 for more information about why we are initializing
    // the ORBClass to PIORB (now ORBImpl, but should check the bugid).
    props.put("org.omg.CORBA.ORBClass",
        "com.sun.corba.se.impl.orb.ORBImpl");

    return (ORB) ORB.init(args, props);
}
 
Example 19
Source Project: jdk8u60   Source File: ServerTool.java    License: GNU General Public License v2.0 6 votes vote down vote up
public boolean processCommand( String[] cmdArgs, ORB orb, PrintStream out )
{
    if ((cmdArgs.length == 2) && cmdArgs[0].equals( "-applicationName" )) {
        String str = (String)cmdArgs[1] ;

        try {
            Repository repository = RepositoryHelper.narrow(
                orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME ));

            try {
                int result = repository.getServerID( str ) ;
                out.println() ;
                out.println(CorbaResourceUtil.getText("servertool.getserverid2", str, Integer.toString(result)));
                out.println() ;
            } catch (ServerNotRegistered e) {
                out.println(CorbaResourceUtil.getText("servertool.nosuchserver"));
            }
        } catch (Exception ex) {
            ex.printStackTrace() ;
        }

        return commandDone ;
    } else
        return parseError ;
}
 
Example 20
static void start( HashMap serverTable ) {
    int sleepTime = ORBConstants.DEFAULT_SERVER_POLLING_TIME;

    String pollingTime = System.getProperties().getProperty(
        ORBConstants.SERVER_POLLING_TIME );

    if ( pollingTime != null ) {
        try {
            sleepTime = Integer.parseInt( pollingTime );
        } catch (Exception e ) {
            // Too late to complain, Just use the default
            // sleepTime
        }
    }

    instance = new ProcessMonitorThread( serverTable,
        sleepTime );
    instance.setDaemon( true );
    instance.start();
}
 
Example 21
Source Project: JDKSourceCode1.8   Source File: DataCollectorBase.java    License: MIT License 6 votes vote down vote up
public DataCollectorBase( Properties props, String localHostName,
    String configurationHostName )
{
    // XXX This is fully initialized here.  So do we ever want to
    // generalize this (or perhaps this is the wrong place for this?)
    URLPropertyNames = new HashSet() ;
    URLPropertyNames.add( ORBConstants.INITIAL_SERVICES_PROPERTY ) ;

    propertyNames = new HashSet() ;

    // Make sure that we are ready to handle -ORBInitRef.  This is special
    // due to the need to handle multiple -ORBInitRef args as prefix
    // parsing.
    propertyNames.add( ORBConstants.ORB_INIT_REF_PROPERTY ) ;

    propertyPrefixes = new HashSet() ;

    this.originalProps = props ;
    this.localHostName = localHostName ;
    this.configurationHostName = configurationHostName ;
    setParserCalled = false ;
    resultProps = new Properties() ;
}
 
Example 22
Source Project: TencentKona-8   Source File: ORBImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
public boolean isLocalServerId( int subcontractId, int serverId )
{
    synchronized (this) {
            checkShutdownState();
    }
    if ((subcontractId < ORBConstants.FIRST_POA_SCID) ||
        (subcontractId > ORBConstants.MAX_POA_SCID))
        return serverId == getTransientServerId( ) ;

    // XXX isTransient info should be stored in subcontract registry
    if (ORBConstants.isTransient( subcontractId ))
        return (serverId == getTransientServerId()) ;
    else if (configData.getPersistentServerIdInitialized())
        return (serverId == configData.getPersistentServerId()) ;
    else
        return false ;
}
 
Example 23
Source Project: TencentKona-8   Source File: POAFactory.java    License: GNU General Public License v2.0 6 votes vote down vote up
public synchronized POA getRootPOA()
{
    if (rootPOA == null) {
        // See if we are trying to getRootPOA while shutting down the ORB.
        if (isShuttingDown) {
            throw omgWrapper.noObjectAdaptor( ) ;
        }

        try {
            Object obj = orb.resolve_initial_references(
                ORBConstants.ROOT_POA_NAME ) ;
            rootPOA = (POAImpl)obj ;
        } catch (InvalidName inv) {
            throw wrapper.cantResolveRootPoa( inv ) ;
        }
    }

    return rootPOA;
}
 
Example 24
Source Project: openjdk-8-source   Source File: ORBImpl.java    License: GNU General Public License v2.0 6 votes vote down vote up
public boolean isLocalServerId( int subcontractId, int serverId )
{
    synchronized (this) {
            checkShutdownState();
    }
    if ((subcontractId < ORBConstants.FIRST_POA_SCID) ||
        (subcontractId > ORBConstants.MAX_POA_SCID))
        return serverId == getTransientServerId( ) ;

    // XXX isTransient info should be stored in subcontract registry
    if (ORBConstants.isTransient( subcontractId ))
        return (serverId == getTransientServerId()) ;
    else if (configData.getPersistentServerIdInitialized())
        return (serverId == configData.getPersistentServerId()) ;
    else
        return false ;
}
 
Example 25
public boolean processCommand( String[] cmdArgs, ORB orb, PrintStream out )
{
    if ((cmdArgs.length == 2) && cmdArgs[0].equals( "-applicationName" )) {
        String str = (String)cmdArgs[1] ;

        try {
            Repository repository = RepositoryHelper.narrow(
                orb.resolve_initial_references( ORBConstants.SERVER_REPOSITORY_NAME ));

            try {
                int result = repository.getServerID( str ) ;
                out.println() ;
                out.println(CorbaResourceUtil.getText("servertool.getserverid2", str, Integer.toString(result)));
                out.println() ;
            } catch (ServerNotRegistered e) {
                out.println(CorbaResourceUtil.getText("servertool.nosuchserver"));
            }
        } catch (Exception ex) {
            ex.printStackTrace() ;
        }

        return commandDone ;
    } else
        return parseError ;
}
 
Example 26
Source Project: openjdk-8-source   Source File: POAFactory.java    License: GNU General Public License v2.0 6 votes vote down vote up
public synchronized POA getRootPOA()
{
    if (rootPOA == null) {
        // See if we are trying to getRootPOA while shutting down the ORB.
        if (isShuttingDown) {
            throw omgWrapper.noObjectAdaptor( ) ;
        }

        try {
            Object obj = orb.resolve_initial_references(
                ORBConstants.ROOT_POA_NAME ) ;
            rootPOA = (POAImpl)obj ;
        } catch (InvalidName inv) {
            throw wrapper.cantResolveRootPoa( inv ) ;
        }
    }

    return rootPOA;
}
 
Example 27
/** This static method takes a Stringified IOR and converts it into IOR object.
  * It is the caller's responsibility to only pass strings that start with "IOR:".
  */
private org.omg.CORBA.Object getIORFromString( String str )
{
    // Length must be even for str to be valid
    if ( (str.length() & 1) == 1 )
        throw wrapper.badStringifiedIorLen() ;

    byte[] buf = new byte[(str.length() - ORBConstants.STRINGIFY_PREFIX.length()) / NIBBLES_PER_BYTE];
    for (int i=ORBConstants.STRINGIFY_PREFIX.length(), j=0; i < str.length(); i +=NIBBLES_PER_BYTE, j++) {
         buf[j] = (byte)((ORBUtility.hexOf(str.charAt(i)) << UN_SHIFT) & 0xF0);
         buf[j] |= (byte)(ORBUtility.hexOf(str.charAt(i+1)) & 0x0F);
    }
    EncapsInputStream s = EncapsInputStreamFactory.newEncapsInputStream(orb, buf, buf.length,
            orb.getORBData().getGIOPVersion());
    s.consumeEndian();
    return s.read_Object() ;
}
 
Example 28
Source Project: JDKSourceCode1.8   Source File: ProcessMonitorThread.java    License: MIT License 6 votes vote down vote up
static void start( HashMap serverTable ) {
    int sleepTime = ORBConstants.DEFAULT_SERVER_POLLING_TIME;

    String pollingTime = System.getProperties().getProperty(
        ORBConstants.SERVER_POLLING_TIME );

    if ( pollingTime != null ) {
        try {
            sleepTime = Integer.parseInt( pollingTime );
        } catch (Exception e ) {
            // Too late to complain, Just use the default
            // sleepTime
        }
    }

    instance = new ProcessMonitorThread( serverTable,
        sleepTime );
    instance.setDaemon( true );
    instance.start();
}
 
Example 29
Source Project: openjdk-8   Source File: ServerMain.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void redirectIOStreams()
{
    // redirect out and err streams
    try {
        String logDirName =
            System.getProperty( ORBConstants.DB_DIR_PROPERTY ) +
            System.getProperty("file.separator") +
            ORBConstants.SERVER_LOG_DIR +
            System.getProperty("file.separator");

        File logDir = new File(logDirName);
        String server = System.getProperty(
            ORBConstants.SERVER_ID_PROPERTY ) ;

        FileOutputStream foutStream =
            new FileOutputStream(logDirName + server+".out", true);
        FileOutputStream ferrStream =
            new FileOutputStream(logDirName + server+".err", true);

        PrintStream pSout = new PrintStream(foutStream, true);
        PrintStream pSerr = new PrintStream(ferrStream, true);

        System.setOut(pSout);
        System.setErr(pSerr);

        logInformation( "Server started" ) ;

    } catch (Exception ex) {}
}
 
Example 30
Source Project: hottub   Source File: ORBConfiguratorImpl.java    License: GNU General Public License v2.0 5 votes vote down vote up
public PropertyParser makeParser()
{
    PropertyParser parser = new PropertyParser() ;
    Operation action = OperationFactory.compose(
        OperationFactory.suffixAction(),
        OperationFactory.classAction()
    ) ;
    parser.addPrefix( ORBConstants.SUN_PREFIX + "ORBUserConfigurators",
        action, "userConfigurators", Class.class ) ;
    return parser ;
}