java.rmi.server.ObjID Java Examples
The following examples show how to use
java.rmi.server.ObjID.
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: 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 #2
Source File: StreamRemoteCall.java From openjdk-8-source 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 #3
Source File: StreamRemoteCall.java From hottub 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 #4
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 #5
Source File: StreamRemoteCall.java From jdk8u-dev-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 #6
Source File: StreamRemoteCall.java From dragonwell8_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 #7
Source File: StreamRemoteCall.java From openjdk-jdk8u-backup 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 #8
Source File: Activation.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Construct a new Activator on a specified port. */ ActivatorImpl(int port, RMIServerSocketFactory ssf) throws RemoteException { /* Server ref must be created and assigned before remote object * 'this' can be exported. */ LiveRef lref = new LiveRef(new ObjID(ObjID.ACTIVATOR_ID), port, null, ssf); UnicastServerRef uref = new UnicastServerRef(lref); ref = uref; uref.exportObject(this, null, false); }
Example #9
Source File: DGCImpl.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
public Void run() { ClassLoader savedCcl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader( ClassLoader.getSystemClassLoader()); /* * Put remote collector object in table by hand to prevent * listen on port. (UnicastServerRef.exportObject would * cause transport to listen.) */ try { dgc = new DGCImpl(); ObjID dgcID = new ObjID(ObjID.DGC_ID); LiveRef ref = new LiveRef(dgcID, 0); UnicastServerRef disp = new UnicastServerRef(ref); Remote stub = Util.createProxy(DGCImpl.class, new UnicastRef(ref), true); disp.setSkeleton(dgc); Target target = new Target(dgc, disp, stub, dgcID, true); ObjectTable.putTarget(target); } catch (RemoteException e) { throw new Error( "exception initializing server-side DGC", e); } } finally { Thread.currentThread().setContextClassLoader(savedCcl); } return null; }
Example #10
Source File: LiveRef.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Construct a new live reference for a server object in the local * address space, to use sockets of the specified type. */ public LiveRef(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) { this((new ObjID()), port, csf, ssf); }
Example #11
Source File: DGCClient.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
/** * Create an array of ObjIDs (needed for the DGC remote calls) * from the ids in the given set of refs. */ private static ObjID[] createObjIDArray(Set<RefEntry> refEntries) { ObjID[] ids = new ObjID[refEntries.size()]; Iterator<RefEntry> iter = refEntries.iterator(); for (int i = 0; i < ids.length; i++) { ids[i] = iter.next().getRef().getObjID(); } return ids; }
Example #12
Source File: Target.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Construct a Target for a remote object "impl" with * a specific object id. * * If "permanent" is true, then the impl is pinned permanently * (the impl will not be collected via distributed and/or local * GC). If "on" is false, than the impl is subject to * collection. Permanent objects do not keep a server from * exiting. */ public Target(Remote impl, Dispatcher disp, Remote stub, ObjID id, boolean permanent) { this.weakImpl = new WeakRef(impl, ObjectTable.reapQueue); this.disp = disp; this.stub = stub; this.id = id; this.acc = AccessController.getContext(); /* * Fix for 4149366: so that downloaded parameter types unmarshalled * for this impl will be compatible with types known only to the * impl class's class loader (when it's not identical to the * exporting thread's context class loader), mark the impl's class * loader as the loader to use as the context class loader in the * server's dispatch thread while a call to this impl is being * processed (unless this exporting thread's context class loader is * a child of the impl's class loader, such as when a registry is * exported by an application, in which case this thread's context * class loader is preferred). */ ClassLoader threadContextLoader = Thread.currentThread().getContextClassLoader(); ClassLoader serverLoader = impl.getClass().getClassLoader(); if (checkLoaderAncestry(threadContextLoader, serverLoader)) { this.ccl = threadContextLoader; } else { this.ccl = serverLoader; } this.permanent = permanent; if (permanent) { pinImpl(); } }
Example #13
Source File: DGCImpl.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * The clean call removes the VMID from the set of clients * that hold references to the object associated with the LiveRef * ref. The sequence number is used to detect late clean calls. If the * argument "strong" is true, then the clean call is a result of a * failed "dirty" call, thus the sequence number for the VMID needs * to be remembered until the client goes away. */ public void clean(ObjID[] ids, long sequenceNum, VMID vmid, boolean strong) { for (ObjID id : ids) { if (dgcLog.isLoggable(Log.VERBOSE)) { dgcLog.log(Log.VERBOSE, "id = " + id + ", vmid = " + vmid + ", strong = " + strong); } ObjectTable.unreferenced(id, sequenceNum, vmid, strong); } }
Example #14
Source File: ObjectTable.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
/** * Process client VM dropping reference for given ObjID: forward to * corresponding Target entry. If ObjID is not found in table, * no action is taken. */ static void unreferenced(ObjID id, long sequenceNum, VMID vmid, boolean strong) { synchronized (tableLock) { ObjectEndpoint oe = new ObjectEndpoint(id, Transport.currentTransport()); Target target = objTable.get(oe); if (target != null) target.unreferenced(sequenceNum, vmid, strong); } }
Example #15
Source File: ObjectTable.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Process client VM dropping reference for given ObjID: forward to * corresponding Target entry. If ObjID is not found in table, * no action is taken. */ static void unreferenced(ObjID id, long sequenceNum, VMID vmid, boolean strong) { synchronized (tableLock) { ObjectEndpoint oe = new ObjectEndpoint(id, Transport.currentTransport()); Target target = objTable.get(oe); if (target != null) target.unreferenced(sequenceNum, vmid, strong); } }
Example #16
Source File: Target.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
/** * Construct a Target for a remote object "impl" with * a specific object id. * * If "permanent" is true, then the impl is pinned permanently * (the impl will not be collected via distributed and/or local * GC). If "on" is false, than the impl is subject to * collection. Permanent objects do not keep a server from * exiting. */ public Target(Remote impl, Dispatcher disp, Remote stub, ObjID id, boolean permanent) { this.weakImpl = new WeakRef(impl, ObjectTable.reapQueue); this.disp = disp; this.stub = stub; this.id = id; this.acc = AccessController.getContext(); /* * Fix for 4149366: so that downloaded parameter types unmarshalled * for this impl will be compatible with types known only to the * impl class's class loader (when it's not identical to the * exporting thread's context class loader), mark the impl's class * loader as the loader to use as the context class loader in the * server's dispatch thread while a call to this impl is being * processed (unless this exporting thread's context class loader is * a child of the impl's class loader, such as when a registry is * exported by an application, in which case this thread's context * class loader is preferred). */ ClassLoader threadContextLoader = Thread.currentThread().getContextClassLoader(); ClassLoader serverLoader = impl.getClass().getClassLoader(); if (checkLoaderAncestry(threadContextLoader, serverLoader)) { this.ccl = threadContextLoader; } else { this.ccl = serverLoader; } this.permanent = permanent; if (permanent) { pinImpl(); } }
Example #17
Source File: Activation.java From hottub with GNU General Public License v2.0 | 5 votes |
ActivationSystemImpl(int port, RMIServerSocketFactory ssf) throws RemoteException { /* Server ref must be created and assigned before remote object * 'this' can be exported. */ LiveRef lref = new LiveRef(new ObjID(4), port, null, ssf); UnicastServerRef uref = new UnicastServerRef(lref); ref = uref; uref.exportObject(this, null); }
Example #18
Source File: LiveRef.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
public static LiveRef read(ObjectInput in, boolean useNewFormat) throws IOException, ClassNotFoundException { Endpoint ep; ObjID id; // Now read in the endpoint, id, and result flag // (need to choose whether or not to read old JDK1.1 endpoint format) if (useNewFormat) { ep = TCPEndpoint.read(in); } else { ep = TCPEndpoint.readHostPortFormat(in); } id = ObjID.read(in); boolean isResultStream = in.readBoolean(); LiveRef ref = new LiveRef(id, ep, false); if (in instanceof ConnectionInputStream) { ConnectionInputStream stream = (ConnectionInputStream)in; // save ref to send "dirty" call after all args/returns // have been unmarshaled. stream.saveRef(ref); if (isResultStream) { // set flag in stream indicating that remote objects were // unmarshaled. A DGC ack should be sent by the transport. stream.setAckNeeded(); } } else { DGCClient.registerRefs(ep, Arrays.asList(new LiveRef[] { ref })); } return ref; }
Example #19
Source File: DGCImpl.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * The clean call removes the VMID from the set of clients * that hold references to the object associated with the LiveRef * ref. The sequence number is used to detect late clean calls. If the * argument "strong" is true, then the clean call is a result of a * failed "dirty" call, thus the sequence number for the VMID needs * to be remembered until the client goes away. */ public void clean(ObjID[] ids, long sequenceNum, VMID vmid, boolean strong) { for (ObjID id : ids) { if (dgcLog.isLoggable(Log.VERBOSE)) { dgcLog.log(Log.VERBOSE, "id = " + id + ", vmid = " + vmid + ", strong = " + strong); } ObjectTable.unreferenced(id, sequenceNum, vmid, strong); } }
Example #20
Source File: Activation.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Construct a new Activator on a specified port. */ ActivatorImpl(int port, RMIServerSocketFactory ssf) throws RemoteException { /* Server ref must be created and assigned before remote object * 'this' can be exported. */ LiveRef lref = new LiveRef(new ObjID(ObjID.ACTIVATOR_ID), port, null, ssf); UnicastServerRef uref = new UnicastServerRef(lref); ref = uref; uref.exportObject(this, null, false); }
Example #21
Source File: ObjectTable.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Process client VM dropping reference for given ObjID: forward to * corresponding Target entry. If ObjID is not found in table, * no action is taken. */ static void unreferenced(ObjID id, long sequenceNum, VMID vmid, boolean strong) { synchronized (tableLock) { ObjectEndpoint oe = new ObjectEndpoint(id, Transport.currentTransport()); Target target = objTable.get(oe); if (target != null) target.unreferenced(sequenceNum, vmid, strong); } }
Example #22
Source File: DGCImpl.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * The clean call removes the VMID from the set of clients * that hold references to the object associated with the LiveRef * ref. The sequence number is used to detect late clean calls. If the * argument "strong" is true, then the clean call is a result of a * failed "dirty" call, thus the sequence number for the VMID needs * to be remembered until the client goes away. */ public void clean(ObjID[] ids, long sequenceNum, VMID vmid, boolean strong) { for (ObjID id : ids) { if (dgcLog.isLoggable(Log.VERBOSE)) { dgcLog.log(Log.VERBOSE, "id = " + id + ", vmid = " + vmid + ", strong = " + strong); } ObjectTable.unreferenced(id, sequenceNum, vmid, strong); } }
Example #23
Source File: LiveRef.java From jdk8u-jdk with GNU General Public License v2.0 | 5 votes |
/** * Construct a new live reference for a server object in the local * address space, to use sockets of the specified type. */ public LiveRef(int port, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) { this((new ObjID()), port, csf, ssf); }
Example #24
Source File: DGCImpl.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * ObjectInputFilter to filter DGC input objects. * The list of acceptable classes is very short and explicit. * The depth and array sizes are limited. * * @param filterInfo access to class, arrayLength, etc. * @return {@link ObjectInputFilter.Status#ALLOWED} if allowed, * {@link ObjectInputFilter.Status#REJECTED} if rejected, * otherwise {@link ObjectInputFilter.Status#UNDECIDED} */ private static ObjectInputFilter.Status checkInput(ObjectInputFilter.FilterInfo filterInfo) { if (dgcFilter != null) { ObjectInputFilter.Status status = dgcFilter.checkInput(filterInfo); if (status != ObjectInputFilter.Status.UNDECIDED) { // The DGC filter can override the built-in white-list return status; } } if (filterInfo.depth() > DGC_MAX_DEPTH) { return ObjectInputFilter.Status.REJECTED; } Class<?> clazz = filterInfo.serialClass(); if (clazz != null) { while (clazz.isArray()) { if (filterInfo.arrayLength() >= 0 && filterInfo.arrayLength() > DGC_MAX_ARRAY_SIZE) { return ObjectInputFilter.Status.REJECTED; } // Arrays are allowed depending on the component type clazz = clazz.getComponentType(); } if (clazz.isPrimitive()) { // Arrays of primitives are allowed return ObjectInputFilter.Status.ALLOWED; } return (clazz == ObjID.class || clazz == UID.class || clazz == VMID.class || clazz == Lease.class) ? ObjectInputFilter.Status.ALLOWED : ObjectInputFilter.Status.REJECTED; } // Not a class, not size limited return ObjectInputFilter.Status.UNDECIDED; }
Example #25
Source File: Target.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
/** * Construct a Target for a remote object "impl" with * a specific object id. * * If "permanent" is true, then the impl is pinned permanently * (the impl will not be collected via distributed and/or local * GC). If "on" is false, than the impl is subject to * collection. Permanent objects do not keep a server from * exiting. */ public Target(Remote impl, Dispatcher disp, Remote stub, ObjID id, boolean permanent) { this.weakImpl = new WeakRef(impl, ObjectTable.reapQueue); this.disp = disp; this.stub = stub; this.id = id; this.acc = AccessController.getContext(); /* * Fix for 4149366: so that downloaded parameter types unmarshalled * for this impl will be compatible with types known only to the * impl class's class loader (when it's not identical to the * exporting thread's context class loader), mark the impl's class * loader as the loader to use as the context class loader in the * server's dispatch thread while a call to this impl is being * processed (unless this exporting thread's context class loader is * a child of the impl's class loader, such as when a registry is * exported by an application, in which case this thread's context * class loader is preferred). */ ClassLoader threadContextLoader = Thread.currentThread().getContextClassLoader(); ClassLoader serverLoader = impl.getClass().getClassLoader(); if (checkLoaderAncestry(threadContextLoader, serverLoader)) { this.ccl = threadContextLoader; } else { this.ccl = serverLoader; } this.permanent = permanent; if (permanent) { pinImpl(); } }
Example #26
Source File: ObjectTable.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Process client VM signalling reference for given ObjID: forward to * corresponding Target entry. If ObjID is not found in table, * no action is taken. */ static void referenced(ObjID id, long sequenceNum, VMID vmid) { synchronized (tableLock) { ObjectEndpoint oe = new ObjectEndpoint(id, Transport.currentTransport()); Target target = objTable.get(oe); if (target != null) { target.referenced(sequenceNum, vmid); } } }
Example #27
Source File: ObjectTable.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Process client VM signalling reference for given ObjID: forward to * corresponding Target entry. If ObjID is not found in table, * no action is taken. */ static void referenced(ObjID id, long sequenceNum, VMID vmid) { synchronized (tableLock) { ObjectEndpoint oe = new ObjectEndpoint(id, Transport.currentTransport()); Target target = objTable.get(oe); if (target != null) { target.referenced(sequenceNum, vmid); } } }
Example #28
Source File: ObjectTable.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 5 votes |
/** * Process client VM dropping reference for given ObjID: forward to * corresponding Target entry. If ObjID is not found in table, * no action is taken. */ static void unreferenced(ObjID id, long sequenceNum, VMID vmid, boolean strong) { synchronized (tableLock) { ObjectEndpoint oe = new ObjectEndpoint(id, Transport.currentTransport()); Target target = objTable.get(oe); if (target != null) target.unreferenced(sequenceNum, vmid, strong); } }
Example #29
Source File: ObjectTable.java From jdk8u_jdk with GNU General Public License v2.0 | 5 votes |
/** * Process client VM dropping reference for given ObjID: forward to * corresponding Target entry. If ObjID is not found in table, * no action is taken. */ static void unreferenced(ObjID id, long sequenceNum, VMID vmid, boolean strong) { synchronized (tableLock) { ObjectEndpoint oe = new ObjectEndpoint(id, Transport.currentTransport()); Target target = objTable.get(oe); if (target != null) target.unreferenced(sequenceNum, vmid, strong); } }
Example #30
Source File: Activation.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Construct a new Activator on a specified port. */ ActivatorImpl(int port, RMIServerSocketFactory ssf) throws RemoteException { /* Server ref must be created and assigned before remote object * 'this' can be exported. */ LiveRef lref = new LiveRef(new ObjID(ObjID.ACTIVATOR_ID), port, null, ssf); UnicastServerRef uref = new UnicastServerRef(lref); ref = uref; uref.exportObject(this, null, false); }