sun.rmi.runtime.Log Java Examples
The following examples show how to use
sun.rmi.runtime.Log.
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 check out the related API usage on the sidebar.
Example #1
Source File: RegistryImpl.java From jdk8u_jdk with GNU General Public License v2.0 | 7 votes |
/** * 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.createFilter2(props); Log regLog = Log.getLog("sun.rmi.registry", "registry", -1); if (regLog.isLoggable(Log.BRIEF)) { regLog.log(Log.BRIEF, "registryFilter = " + filter); } } return filter; }
Example #2
Source File: RegistryImpl.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
/** * 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; }
Example #3
Source File: ConnectionMultiplexer.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * 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; } } }
Example #4
Source File: HttpInputStream.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
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; }
Example #5
Source File: StreamRemoteCall.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
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); } }
Example #6
Source File: ConnectionMultiplexer.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * 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; } } }
Example #7
Source File: UnicastRef.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
/** * 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. */ } }
Example #8
Source File: ObjectTable.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
/** * 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 }
Example #9
Source File: Target.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
/** * 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); }
Example #10
Source File: TCPEndpoint.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
/** * 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; }
Example #11
Source File: StreamRemoteCall.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
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); } }
Example #12
Source File: HttpInputStream.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
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; }
Example #13
Source File: ConnectionMultiplexer.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
/** * 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; } } }
Example #14
Source File: HttpSendSocket.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
/** * 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); }
Example #15
Source File: HttpSendSocket.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
/** * 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); }
Example #16
Source File: ObjectTable.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * 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 }
Example #17
Source File: TCPEndpoint.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * 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; }
Example #18
Source File: TCPEndpoint.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * 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; }
Example #19
Source File: ObjectTable.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
/** * 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 }
Example #20
Source File: Target.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * 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); }
Example #21
Source File: ConnectionMultiplexer.java From hottub with GNU General Public License v2.0 | 6 votes |
/** * 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; } } }
Example #22
Source File: UnicastRef.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * 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. */ } }
Example #23
Source File: ConnectionMultiplexer.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * 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; } } }
Example #24
Source File: ConnectionMultiplexer.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * 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; } } }
Example #25
Source File: HttpSendSocket.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * 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); }
Example #26
Source File: HttpInputStream.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
/** * 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; } }
Example #27
Source File: ConnectionMultiplexer.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * 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; } } }
Example #28
Source File: LoaderHandler.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Load a class from a network location (one or more URLs), * but first try to resolve the named class through the given * "default loader". */ public static Class<?> loadClass(String codebase, String name, ClassLoader defaultLoader) throws MalformedURLException, ClassNotFoundException { if (loaderLog.isLoggable(Log.BRIEF)) { loaderLog.log(Log.BRIEF, "name = \"" + name + "\", " + "codebase = \"" + (codebase != null ? codebase : "") + "\"" + (defaultLoader != null ? ", defaultLoader = " + defaultLoader : "")); } URL[] urls; if (codebase != null) { urls = pathToURLs(codebase); } else { urls = getDefaultCodebaseURLs(); } if (defaultLoader != null) { try { Class<?> c = loadClassForName(name, false, defaultLoader); if (loaderLog.isLoggable(Log.VERBOSE)) { loaderLog.log(Log.VERBOSE, "class \"" + name + "\" found via defaultLoader, " + "defined by " + c.getClassLoader()); } return c; } catch (ClassNotFoundException e) { } } return loadClass(urls, name); }
Example #29
Source File: UnicastServerRef.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Log the details of an incoming call. The method parameter is either of * type java.lang.reflect.Method or java.rmi.server.Operation. */ private void logCall(Remote obj, Object method) { if (callLog.isLoggable(Log.VERBOSE)) { String clientHost; try { clientHost = getClientHost(); } catch (ServerNotActiveException snae) { clientHost = "(local)"; // shouldn't happen } callLog.log(Log.VERBOSE, "[" + clientHost + ": " + obj.getClass().getName() + ref.getObjID().toString() + ": " + method + "]"); } }
Example #30
Source File: TCPEndpoint.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Resamples the local hostname and returns the possibly-updated * local hostname. */ private static String resampleLocalHost() { String hostnameProperty = getHostnameProperty(); synchronized (localEndpoints) { // assert(localHostKnown ^ (localHost == null)) if (hostnameProperty != null) { if (!localHostKnown) { /* * If the local hostname is unknown, update ALL * existing endpoints with the new hostname. */ setLocalHost(hostnameProperty); } else if (!hostnameProperty.equals(localHost)) { /* * Only update the localHost field for reference * in future endpoint creation. */ localHost = hostnameProperty; if (TCPTransport.tcpLog.isLoggable(Log.BRIEF)) { TCPTransport.tcpLog.log(Log.BRIEF, "updated local hostname to: " + localHost); } } } return localHost; } }