private void handleResolveObj(NamingException exception) { Object resolvedObj = exception.getResolvedObj(); boolean serializable = resolvedObj instanceof Serializable; if (resolvedObj != null && !serializable) { exception.setResolvedObj(null); } }
private synchronized void writeObject(final ObjectOutputStream out) throws IOException { final Object resolvedObj = getResolvedObj(); if (isSerializable(resolvedObj)) { out.defaultWriteObject(); } else { final NamingException namingException = (NamingException) getCause(); namingException.setResolvedObj(null); try { out.defaultWriteObject(); } finally { namingException.setResolvedObj(resolvedObj); } } } }
private synchronized void writeObject(final ObjectOutputStream out) throws IOException { final Principal thisPrincipal = this.principal; if (!isSerializable(thisPrincipal)) { this.principal = null; } final Object resolvedObj = getResolvedObj(); NamingException namingException = null; if (!isSerializable(resolvedObj)) { namingException = (NamingException) getCause(); namingException.setResolvedObj(null); } try { out.defaultWriteObject(); } finally { this.principal = thisPrincipal; if (namingException != null) { namingException.setResolvedObj(resolvedObj); } } } }
@Before public void setUp() throws Exception { message = testName.getMethodName() + " message"; causeMessage = testName.getMethodName() + " cause message"; nonSerializableResolvedObj = new Object(); nonSerializableNamingException = new NamingException(causeMessage); nonSerializableNamingException.setResolvedObj(nonSerializableResolvedObj); serializableResolvedObj = new SerializableObject(testName.getMethodName()); serializableNamingException = new NamingException(causeMessage); serializableNamingException.setResolvedObj(serializableResolvedObj); assertPreConditions(); }
@Before public void setUp() throws Exception { message = testName.getMethodName() + " message"; causeMessage = testName.getMethodName() + " cause message"; nonSerializableResolvedObj = new Object(); nonSerializableNamingException = new NamingException(causeMessage); nonSerializableNamingException.setResolvedObj(nonSerializableResolvedObj); serializableResolvedObj = new SerializableObject(testName.getMethodName()); serializableNamingException = new NamingException(causeMessage); serializableNamingException.setResolvedObj(serializableResolvedObj); principalName = "jsmith"; nonSerializablePrincipal = mock(Principal.class); serializablePrincipal = new SerializablePrincipal(principalName); assertPreconditions(); }
ne.setResolvedObj(new CNCtx(ctx._orb, nc, ctx._env, ctx.makeFullName(resolvedName))); } else { ne.setResolvedObj(ctx);
private void handleResolveObj(NamingException exception) { Object resolvedObj = exception.getResolvedObj(); boolean serializable = resolvedObj instanceof Serializable; if (resolvedObj != null && !serializable) { exception.setResolvedObj(null); } }
/** * Checks if the <tt>resolvedObj</tt> of the causing exception is * suspected to be non-serializable, and if so temporarily nulls it before * calling the default serialization mechanism. * * @param stream * the stream onto which this object is serialized * @throws IOException * if there is an error writing this object to the stream */ private void writeObject(ObjectOutputStream stream) throws IOException { Object resolvedObj = getResolvedObj(); boolean serializable = resolvedObj instanceof Serializable; if (resolvedObj != null && !serializable) { // the cause is of this type, since resolvedObj is not null javax.naming.NamingException namingException = (javax.naming.NamingException) getCause(); namingException.setResolvedObj(null); try { stream.defaultWriteObject(); } finally { namingException.setResolvedObj(resolvedObj); } } else { stream.defaultWriteObject(); } } }
/** * Checks if the <tt>resolvedObj</tt> of the causing exception is * suspected to be non-serializable, and if so temporarily nulls it before * calling the default serialization mechanism. * * @param stream * the stream onto which this object is serialized * @throws IOException * if there is an error writing this object to the stream */ private void writeObject(ObjectOutputStream stream) throws IOException { Object resolvedObj = getResolvedObj(); boolean serializable = resolvedObj instanceof Serializable; if (resolvedObj != null && !serializable) { // the cause is of this type, since resolvedObj is not null javax.naming.NamingException namingException = (javax.naming.NamingException) getCause(); namingException.setResolvedObj(null); try { stream.defaultWriteObject(); } finally { namingException.setResolvedObj(resolvedObj); } } else { stream.defaultWriteObject(); } } }
/** * Checks if the <tt>resolvedObj</tt> of the causing exception is * suspected to be non-serializable, and if so temporarily nulls it before * calling the default serialization mechanism. * * @param stream * the stream onto which this object is serialized * @throws IOException * if there is an error writing this object to the stream */ private void writeObject(ObjectOutputStream stream) throws IOException { Object resolvedObj = getResolvedObj(); boolean serializable = resolvedObj instanceof Serializable; if (resolvedObj != null && !serializable) { // the cause is of this type, since resolvedObj is not null javax.naming.NamingException namingException = (javax.naming.NamingException) getCause(); namingException.setResolvedObj(null); try { stream.defaultWriteObject(); } finally { namingException.setResolvedObj(resolvedObj); } } else { stream.defaultWriteObject(); } } }
/** * Checks if the <tt>resolvedObj</tt> of the causing exception is * suspected to be non-serializable, and if so temporarily nulls it before * calling the default serialization mechanism. * * @param stream * the stream onto which this object is serialized * @throws IOException * if there is an error writing this object to the stream */ private void writeObject(ObjectOutputStream stream) throws IOException { Object resolvedObj = getResolvedObj(); boolean serializable = resolvedObj instanceof Serializable; if (resolvedObj != null && !serializable) { // the cause is of this type, since resolvedObj is not null javax.naming.NamingException namingException = (javax.naming.NamingException) getCause(); namingException.setResolvedObj(null); try { stream.defaultWriteObject(); } finally { namingException.setResolvedObj(resolvedObj); } } else { stream.defaultWriteObject(); } } }
ne.setResolvedObj(new CNCtx(ctx._orb, nc, ctx._env, ctx.makeFullName(resolvedName))); } else { ne.setResolvedObj(ctx);
ne.setResolvedObj(new CNCtx(ctx._orb, nc, ctx._env, ctx.makeFullName(resolvedName))); } else { ne.setResolvedObj(ctx);
ne.setResolvedObj(new CNCtx(ctx._orb, ctx.orbTracker, nc, ctx._env, ctx.makeFullName(resolvedName))); } else { ne.setResolvedObj(ctx);