当前位置: 首页>>代码示例>>Java>>正文


Java Log类代码示例

本文整理汇总了Java中sun.rmi.runtime.Log的典型用法代码示例。如果您正苦于以下问题:Java Log类的具体用法?Java Log怎么用?Java Log使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Log类属于sun.rmi.runtime包,在下文中一共展示了Log类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initRegistryFilter

import sun.rmi.runtime.Log; //导入依赖的package包/类
/**
 * Initialize the registryFilter from the security properties or system property; if any
 * @return an ObjectInputFilter, or null
 */
private static ObjectInputFilter initRegistryFilter() {
    ObjectInputFilter filter = null;
    String props = System.getProperty(REGISTRY_FILTER_PROPNAME);
    if (props == null) {
        props = Security.getProperty(REGISTRY_FILTER_PROPNAME);
    }
    if (props != null) {
        filter = ObjectInputFilter.Config.createFilter(props);
        Log regLog = Log.getLog("sun.rmi.registry", "registry", -1);
        if (regLog.isLoggable(Log.BRIEF)) {
            regLog.log(Log.BRIEF, "registryFilter = " + filter);
        }
    }
    return filter;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:20,代码来源:RegistryImpl.java

示例2: unreferenced

import sun.rmi.runtime.Log; //导入依赖的package包/类
/**
 * Remove endpoint from remembered set.  If set becomes empty,
 * remove server from Transport's object table.
 */
synchronized void unreferenced(long sequenceNum, VMID vmid, boolean strong)
{
    // check sequence number for vmid
    SequenceEntry entry = sequenceTable.get(vmid);
    if (entry == null || entry.sequenceNum > sequenceNum) {
        // late clean call; ignore
        return;
    } else if (strong) {
        // strong clean call; retain sequenceNum
        entry.retain(sequenceNum);
    } else if (entry.keep == false) {
        // get rid of sequence number
        sequenceTable.remove(vmid);
    }

    if (DGCImpl.dgcLog.isLoggable(Log.VERBOSE)) {
        DGCImpl.dgcLog.log(Log.VERBOSE, "remove from dirty set: " + vmid);
    }

    refSetRemove(vmid);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:26,代码来源:Target.java

示例3: done

import sun.rmi.runtime.Log; //导入依赖的package包/类
/**
 * Done should only be called if the invoke returns successfully
 * (non-exceptionally) to the stub. It allows the remote reference to
 * clean up (or reuse) the connection.
 */
public void done(RemoteCall call) throws RemoteException {

    /* Done only uses the connection inside the call to obtain the
     * channel the connection uses.  Once all information is read
     * from the connection, the connection may be freed.
     */
    clientRefLog.log(Log.BRIEF, "free connection (reuse = true)");

    /* Free the call connection early. */
    free(call, true);

    try {
        call.done();
    } catch (IOException e) {
        /* WARNING: If the conn has been reused early, then it is
         * too late to recover from thrown IOExceptions caught
         * here. This code is relying on StreamRemoteCall.done()
         * not actually throwing IOExceptions.
         */
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:27,代码来源:UnicastRef.java

示例4: HttpSendSocket

import sun.rmi.runtime.Log; //导入依赖的package包/类
/**
 * Create a stream socket and connect it to the specified port on
 * the specified host.
 * @param host the host
 * @param port the port
 */
public HttpSendSocket(String host, int port, URL url) throws IOException
{
    super((SocketImpl)null);        // no underlying SocketImpl for this object

    if (RMIMasterSocketFactory.proxyLog.isLoggable(Log.VERBOSE)) {
        RMIMasterSocketFactory.proxyLog.log(Log.VERBOSE,
            "host = " + host + ", port = " + port + ", url = " + url);
    }

    this.host = host;
    this.port = port;
    this.url = url;

    inNotifier = new HttpSendInputStream(null, this);
    outNotifier = new HttpSendOutputStream(writeNotify(), this);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:HttpSendSocket.java

示例5: read

import sun.rmi.runtime.Log; //导入依赖的package包/类
public int read(byte b[], int off, int len) throws IOException
{
    if (bytesLeft == 0 && len > 0) {
        RMIMasterSocketFactory.proxyLog.log(Log.VERBOSE,
                                            "read past content length");

        return -1;
    }
    if (len > bytesLeft)
        len = bytesLeft;
    int bytesRead = in.read(b, off, len);
    bytesLeft -= bytesRead;

    if (RMIMasterSocketFactory.proxyLog.isLoggable(Log.VERBOSE)) {
        RMIMasterSocketFactory.proxyLog.log(Log.VERBOSE,
            "read " + bytesRead + " bytes, " + bytesLeft + " remaining");
    }

    return bytesRead;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:HttpInputStream.java

示例6: sendRequest

import sun.rmi.runtime.Log; //导入依赖的package包/类
/**
 * Send request for more data on connection to remote endpoint.
 * @param info connection information structure
 * @param len number of more bytes that can be received
 */
void sendRequest(MultiplexConnectionInfo info, int len) throws IOException
{
    synchronized (dataOut) {
        if (alive && !info.closed)
            try {
                dataOut.writeByte(REQUEST);
                dataOut.writeShort(info.id);
                dataOut.writeInt(len);
                dataOut.flush();
            } catch (IOException e) {
                multiplexLog.log(Log.BRIEF, "exception: ", e);

                shutDown();
                throw e;
            }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:ConnectionMultiplexer.java

示例7: sendTransmit

import sun.rmi.runtime.Log; //导入依赖的package包/类
/**
 * Send packet of requested data on connection to remote endpoint.
 * @param info connection information structure
 * @param buf array containing bytes to send
 * @param off offset of first array index of packet
 * @param len number of bytes in packet to send
 */
void sendTransmit(MultiplexConnectionInfo info,
                  byte buf[], int off, int len) throws IOException
{
    synchronized (dataOut) {
        if (alive && !info.closed)
            try {
                dataOut.writeByte(TRANSMIT);
                dataOut.writeShort(info.id);
                dataOut.writeInt(len);
                dataOut.write(buf, off, len);
                dataOut.flush();
            } catch (IOException e) {
                multiplexLog.log(Log.BRIEF, "exception: ", e);

                shutDown();
                throw e;
            }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:ConnectionMultiplexer.java

示例8: sendClose

import sun.rmi.runtime.Log; //导入依赖的package包/类
/**
 * Inform remote endpoint that connection has been closed.
 * @param info connection information structure
 */
void sendClose(MultiplexConnectionInfo info) throws IOException
{
    info.out.disconnect();
    synchronized (dataOut) {
        if (alive && !info.closed)
            try {
                dataOut.writeByte(CLOSE);
                dataOut.writeShort(info.id);
                dataOut.flush();
                info.closed = true;
            } catch (IOException e) {
                multiplexLog.log(Log.BRIEF, "exception: ", e);

                shutDown();
                throw e;
            }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:ConnectionMultiplexer.java

示例9: sendCloseAck

import sun.rmi.runtime.Log; //导入依赖的package包/类
/**
 * Acknowledge remote endpoint's closing of connection.
 * @param info connection information structure
 */
void sendCloseAck(MultiplexConnectionInfo info) throws IOException
{
    synchronized (dataOut) {
        if (alive && !info.closed)
            try {
                dataOut.writeByte(CLOSEACK);
                dataOut.writeShort(info.id);
                dataOut.flush();
                info.closed = true;
            } catch (IOException e) {
                multiplexLog.log(Log.BRIEF, "exception: ", e);

                shutDown();
                throw e;
            }
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:ConnectionMultiplexer.java

示例10: StreamRemoteCall

import sun.rmi.runtime.Log; //导入依赖的package包/类
public StreamRemoteCall(Connection c, ObjID id, int op, long hash)
    throws RemoteException
{
    try {
        conn = c;
        Transport.transportLog.log(Log.VERBOSE,
            "write remote call header...");

        // write out remote call header info...
        // call header, part 1 (read by Transport)
        conn.getOutputStream().write(TransportConstants.Call);
        getOutputStream();           // creates a MarshalOutputStream
        id.write(out);               // object id (target of call)
        // call header, part 2 (read by Dispatcher)
        out.writeInt(op);            // method number (operation index)
        out.writeLong(hash);         // stub/skeleton hash
    } catch (IOException e) {
        throw new MarshalException("Error marshaling call header", e);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:StreamRemoteCall.java

示例11: removeTarget

import sun.rmi.runtime.Log; //导入依赖的package包/类
/**
 * Remove target from object table.
 *
 * NOTE: This method must only be invoked while synchronized on
 * the "tableLock" object, because it does not do so itself.
 */
private static void removeTarget(Target target) {
    // assert Thread.holdsLock(tableLock);

    ObjectEndpoint oe = target.getObjectEndpoint();
    WeakRef weakImpl = target.getWeakImpl();

    if (DGCImpl.dgcLog.isLoggable(Log.VERBOSE)) {
        DGCImpl.dgcLog.log(Log.VERBOSE, "remove object " + oe);
    }

    objTable.remove(oe);
    implTable.remove(weakImpl);

    target.markRemoved();   // handles decrementing keep-alive count
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:22,代码来源:ObjectTable.java

示例12: read

import sun.rmi.runtime.Log; //导入依赖的package包/类
/**
 * Read a byte of data from the stream.  Make sure that one is available
 * from the proper content of the message, else -1 is returned to
 * indicate to the user that the end of the stream has been reached.
 */
public int read() throws IOException
{
    if (bytesLeft > 0) {
        int data = in.read();
        if (data != -1)
            -- bytesLeft;

        if (RMIMasterSocketFactory.proxyLog.isLoggable(Log.VERBOSE)) {
            RMIMasterSocketFactory.proxyLog.log(Log.VERBOSE,
               "received byte: '" +
                ((data & 0x7F) < ' ' ? " " : String.valueOf((char) data)) +
                "' " + data);
        }

        return data;
    }
    else {
        RMIMasterSocketFactory.proxyLog.log(Log.VERBOSE,
                                            "read past content length");

        return -1;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:29,代码来源:HttpInputStream.java

示例13: newServerSocket

import sun.rmi.runtime.Log; //导入依赖的package包/类
/**
 * Return new server socket to listen for connections on this endpoint.
 */
ServerSocket newServerSocket() throws IOException {
    if (TCPTransport.tcpLog.isLoggable(Log.VERBOSE)) {
        TCPTransport.tcpLog.log(Log.VERBOSE,
            "creating server socket on " + this);
    }

    RMIServerSocketFactory serverFactory = ssf;
    if (serverFactory == null) {
        serverFactory = chooseFactory();
    }
    ServerSocket server = serverFactory.createServerSocket(listenPort);

    // if we listened on an anonymous port, set the default port
    // (for this socket factory)
    if (listenPort == 0)
        setDefaultPort(server.getLocalPort(), csf, ssf);

    return server;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:23,代码来源:TCPEndpoint.java

示例14: initDgcFilter

import sun.rmi.runtime.Log; //导入依赖的package包/类
/**
 * Initialize the dgcFilter from the security properties or system property; if any
 * @return an ObjectInputFilter, or null
 */
private static ObjectInputFilter initDgcFilter() {
    ObjectInputFilter filter = null;
    String props = System.getProperty(DGC_FILTER_PROPNAME);
    if (props == null) {
        props = Security.getProperty(DGC_FILTER_PROPNAME);
    }
    if (props != null) {
        filter = ObjectInputFilter.Config.createFilter(props);
        if (dgcLog.isLoggable(Log.BRIEF)) {
            dgcLog.log(Log.BRIEF, "dgcFilter = " + filter);
        }
    }
    return filter;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:19,代码来源:DGCImpl.java

示例15: referenced

import sun.rmi.runtime.Log; //导入依赖的package包/类
/**
 * Add an endpoint to the remembered set.  Also adds a notifier
 * to call back if the address space associated with the endpoint
 * dies.
 */
synchronized void referenced(long sequenceNum, VMID vmid) {
    // check sequence number for vmid
    SequenceEntry entry = sequenceTable.get(vmid);
    if (entry == null) {
        sequenceTable.put(vmid, new SequenceEntry(sequenceNum));
    } else if (entry.sequenceNum < sequenceNum) {
        entry.update(sequenceNum);
    } else  {
        // late dirty call; ignore.
        return;
    }

    if (!refSet.contains(vmid)) {
        /*
         * A Target must be pinned while its refSet is not empty.  It may
         * have become unpinned if external LiveRefs only existed in
         * serialized form for some period of time, or if a client failed
         * to renew its lease due to a transient network failure.  So,
         * make sure that it is pinned here; this fixes bugid 4069644.
         */
        pinImpl();
        if (getImpl() == null)      // too late if impl was collected
            return;

        if (DGCImpl.dgcLog.isLoggable(Log.VERBOSE)) {
            DGCImpl.dgcLog.log(Log.VERBOSE, "add to dirty set: " + vmid);
        }

        refSet.addElement(vmid);

        DGCImpl.getDGCImpl().registerTarget(vmid, this);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:39,代码来源:Target.java


注:本文中的sun.rmi.runtime.Log类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。