/** Reads external. */ public void readExternal(ObjectInput oi) throws IOException, ClassNotFoundException { for (;;) { String file = (String) oi.readObject(); if (file == null) { break; } for (;;) { String attr = (String) oi.readObject(); if (attr == null) { break; } Object o = oi.readObject(); // backward compatibility if (o instanceof java.rmi.MarshalledObject) { o = ((java.rmi.MarshalledObject) o).get(); o = new NbMarshalledObject(o); } // end of backward compatibility if (o instanceof NbMarshalledObject) { setAttr(file, attr, o); } } } } }
/** Creates a new instance of MashalledValuePair */ public MarshalledValuePair(Object value) throws IOException { this.value = value; this.marshalledValue = new MarshalledObject(value); }
/** * Return the <code>hashCode</code> of the <code>MarshalledObject</code>. */ public int hashCode() { return bytes.hashCode(); // value of obj.hashCode() }
/** * Constructs a new selection with the given list of session nodes. */ public LayoutSelection(Graph layoutGraph) { if (layoutGraph == null) { throw new NullPointerException("Layout graph must not be null."); } Object result; try { result = new MarshalledObject(layoutGraph).get(); } catch (Exception e1) { e1.printStackTrace(); throw new IllegalStateException("Could not clone."); } this.layoutGraph = (Graph) result; }
/** * Returns <code>true</code> if the two input objects are the same in * <code>MarshalledObject</code> form, <code>false</code> otherwise. */ private static boolean equal(Object o1, Object o2) { if (o1 == o2) return true; if (o1 == null || o2 == null) return false; Class c = o1.getClass(); if (c == String.class || c == Integer.class || c == Boolean.class || c == Character.class || c == Long.class || c == Float.class || c == Double.class || c == Byte.class || c == Short.class) return o1.equals(o2); try { return new MarshalledObject(o1).equals(new MarshalledObject(o2)); } catch (IOException ex) { throw new IllegalArgumentException("unexpected IOException"); } }
mo = new MarshalledObject(id); hashCode = mo.hashCode();
/** This method uses the id implementation of equals if the mo is *null since this indicates that the id class did implement equals. *If mo is not null, then the MarshalledObject equals is used to *compare keys based on their serialized form. Relying on the *serialized form does not always work. */ public boolean equals(Object object) { boolean equals = false; if (object instanceof CacheKey) { CacheKey ckey = (CacheKey) object; Object key = ckey.id; // If mo is null, the id class implements equals if( mo == null ) equals = id.equals(key); else equals = mo.equals(ckey.mo); } return equals; }
private void setSemPm(SemPm oldSemPm) { try { SemPm pm = (SemPm) new MarshalledObject(oldSemPm).get(); setSemPm(pm); } catch (IOException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } }
/** * Constructs a new selection with the given list of session nodes. */ public KnowledgeSelection(IKnowledge knowledge) { if (knowledge == null) { throw new NullPointerException("Knowledge must not be null."); } Object result; try { result = new MarshalledObject(knowledge).get(); } catch (Exception e1) { e1.printStackTrace(); throw new IllegalStateException("Could not clone."); } this.knowledge = (IKnowledge) result; }
public Object get() throws ClassNotFoundException, IOException { Object theValue = enableCallByReference ? value : null; if( theValue == null && marshalledValue != null ) theValue = marshalledValue.get(); return theValue; } }
public void setNamingProxy(Object proxy) throws IOException { serverStub = new MarshalledObject(proxy); }
/** * Constructs a new selection with the given list of session nodes. */ public SubsessionSelection(List sessionElements) { if (sessionElements == null) { throw new NullPointerException( "List of session elements must " + "not be null."); } for (Object sessionElement : sessionElements) { if (!(sessionElement instanceof GraphNode || sessionElement instanceof Edge)) { throw new IllegalArgumentException("Model node list contains " + "an object that is not a GraphNode or an Edge: " + sessionElement); } } try { this.sessionElements = (List) new MarshalledObject(sessionElements).get(); } catch (Exception e1) { e1.printStackTrace(); throw new IllegalStateException("Could not clone."); } }
public static Object unmarshal(MarshalledObject obj) throws IOException, ClassNotFoundException { return obj.get(); } }
/** * Returns a MarshalledObject obtained by marshalling the given object. */ public static MarshalledObject marshal(Object object) throws IOException { if (object == null) return null; return new MarshalledObject(object); }
SemIm _semIm = new MarshalledObject<>(semIm).get();
public Object getNamingProxy() throws Exception { return serverStub.get(); } public void setNamingProxy(Object proxy)
private static MarshalledObject<Message> marshall(final Message msg) { try { return new MarshalledObject<>(msg); } catch (final Exception ex) { return null; } }
/** * Constructs a new selection with the given list of graph nodes. */ public SubgraphSelection(List graphElements) { if (graphElements == null) { throw new NullPointerException( "List of graph elements must " + "not be null."); } for (Object graphElement : graphElements) { if (!(graphElement instanceof Node || graphElement instanceof Edge)) { throw new IllegalArgumentException("Model node list contains " + "an object that is not a Node or an Edge: " + graphElement); } } Object result; try { result = new MarshalledObject(graphElements).get(); } catch (Exception e1) { e1.printStackTrace(); throw new IllegalStateException("Could not clone."); } this.graphElements = (List) result; }
/** * Constructs an activatable PersistentRegistrarImpl assigned the given activation ID, based on * a configuration obtained using the provided marshalled string array. */ PersistentRegistrarImpl(ActivationID activationID, MarshalledObject data) throws Exception { super((String[]) data.get(), activationID, true, null); } }
public MarshalledObject getHandback() { try { return new MarshalledObject(task); } catch (IOException e) { return null; } }