protected Object toObject(ClassLoader classLoader, byte[] value) throws IOException, ClassNotFoundException { if (value == null) { return null; } CustomObjectInputStream in = new CustomObjectInputStream(new ByteArrayInputStream(value), classLoader); return in.readObject(); } }
getLogger().debug("Creating custom object input stream for class loader"); ois = new CustomObjectInputStream(bis, classLoader); } else { if (getLogger().isDebugEnabled()) {
private ObjectInputStream createObjectInputStream( final ByteArrayInputStream bis ) throws IOException { final ObjectInputStream ois; ClassLoader classLoader = null; if ( _manager != null && _manager.getContext() != null ) { classLoader = _manager.getContainerClassLoader(); } if ( classLoader != null ) { ois = new CustomObjectInputStream( bis, classLoader ); } else { ois = new ObjectInputStream( bis ); } return ois; }
@Override public HttpSession deserializeInto(byte[] data, HttpSession session) throws IOException, ClassNotFoundException { StandardSession standardSession = (StandardSession) session; BufferedInputStream bis = new BufferedInputStream(new ByteArrayInputStream(data)); ObjectInputStream ois = new CustomObjectInputStream(bis, loader); standardSession.setCreationTime(ois.readLong()); standardSession.readObjectData(ois); return session; } }
protected Object toObject(ClassLoader classLoader, byte[] value) throws IOException, ClassNotFoundException { if (value == null) { return null; } CustomObjectInputStream in = new CustomObjectInputStream(new ByteArrayInputStream(value), classLoader); return in.readObject(); } }
@Override public Object decode(ByteBuf buf, State state) throws IOException { try { ByteBufInputStream in = new ByteBufInputStream(buf); final ObjectInputStream ois; if (containerClassLoader != null) { ois = new CustomObjectInputStream(in, containerClassLoader); } else { ois = new ObjectInputStream(in); } return ois.readObject(); } catch (IOException io) { throw io; } catch (Exception e) { throw new IOException(e); } } };
protected Object toObject(ClassLoader classLoader, byte[] value) throws IOException, ClassNotFoundException { if (value == null) { return null; } CustomObjectInputStream in = new CustomObjectInputStream(new ByteArrayInputStream(value), classLoader); return in.readObject(); } }
private ObjectInputStream createObjectInputStream( final ByteArrayInputStream bis ) throws IOException { final ObjectInputStream ois; ClassLoader classLoader = null; if ( _manager != null && _manager.getContext() != null ) { classLoader = _manager.getContainerClassLoader(); } if ( classLoader != null ) { ois = new CustomObjectInputStream( bis, classLoader ); } else { ois = new ObjectInputStream( bis ); } return ois; }
protected Object toObject(ClassLoader classLoader, byte[] value) throws IOException, ClassNotFoundException { if (value == null) { return null; } CustomObjectInputStream in = new CustomObjectInputStream(new ByteArrayInputStream(value), classLoader); return in.readObject(); } }
/** * Create the object input stream to use to read a session from the store. * Sub-classes <b>must</b> have set the thread context class loader before * calling this method. * * @param is The input stream provided by the sub-class that will provide * the data for a session * * @return An appropriately configured ObjectInputStream from which the * session can be read. * * @throws IOException if a problem occurs creating the ObjectInputStream */ protected ObjectInputStream getObjectInputStream(InputStream is) throws IOException { BufferedInputStream bis = new BufferedInputStream(is); CustomObjectInputStream ois; ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if (manager instanceof ManagerBase) { ManagerBase managerBase = (ManagerBase) manager; ois = new CustomObjectInputStream(bis, classLoader, manager.getContext().getLogger(), managerBase.getSessionAttributeValueClassNamePattern(), managerBase.getWarnOnSessionAttributeFilterFailure()); } else { ois = new CustomObjectInputStream(bis, classLoader); } return ois; }
protected Object toObject(ClassLoader classLoader, byte[] value) throws IOException, ClassNotFoundException { if (value == null) { return null; } CustomObjectInputStream in = new CustomObjectInputStream(new ByteArrayInputStream(value), classLoader); return in.readObject(); } }
/** * Creates an ObjectInputStream that provides special deserialization * logic for classes that are normally not serializable (such as * javax.naming.Context). */ public ObjectInputStream createObjectInputStream(InputStream is) throws IOException { ObjectInputStream ois = null; Loader loader = getLoader(); if (loader != null) { ClassLoader classLoader = loader.getClassLoader(); if (classLoader != null) { try { ois = new CustomObjectInputStream(is, classLoader); } catch (IOException ioe) { log.log(Level.SEVERE, LogFacade.CANNOT_CREATE_OBJECT_INPUT_STREAM, ioe); } } } if (ois == null) { ois = new ObjectInputStream(is); } return ois; }
/** * Create the object input stream to use to read a session from the store. * Sub-classes <b>must</b> have set the thread context class loader before * calling this method. * * @param is The input stream provided by the sub-class that will provide * the data for a session * * @return An appropriately configured ObjectInputStream from which the * session can be read. * * @throws IOException if a problem occurs creating the ObjectInputStream */ protected ObjectInputStream getObjectInputStream(InputStream is) throws IOException { BufferedInputStream bis = new BufferedInputStream(is); CustomObjectInputStream ois; ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); if (manager instanceof ManagerBase) { ManagerBase managerBase = (ManagerBase) manager; ois = new CustomObjectInputStream(bis, classLoader, manager.getContext().getLogger(), managerBase.getSessionAttributeValueClassNamePattern(), managerBase.getWarnOnSessionAttributeFilterFailure()); } else { ois = new CustomObjectInputStream(bis, classLoader); } return ois; }
@Override public Session toSession(DynamoSessionItem sessionItem) { ObjectInputStream ois = null; try { ByteArrayInputStream fis = new ByteArrayInputStream(sessionItem.getSessionData().array()); ois = new CustomObjectInputStream(fis, classLoader); StandardSession session = new StandardSession(manager); session.readObjectData(ois); return session; } catch (Exception e) { throw new SessionConversionException("Unable to convert Dynamo storage representation to a Tomcat Session", e); } finally { IOUtils.closeQuietly(ois, null); } }
if (log.isDebugEnabled()) log.debug("Creating custom object input stream for class loader "); ois = new CustomObjectInputStream(bis, classLoader); } else { if (log.isDebugEnabled())
ois = new CustomObjectInputStream(bis, classLoader); } else {
/* 360 */ if (this.log.isDebugEnabled()) /* 361 */ this.log.debug("Creating custom object input stream for class loader "); /* 362 */ ois = new CustomObjectInputStream(bis, classLoader); /* */ } else { /* 364 */ if (this.log.isDebugEnabled())
classLoader = loader.getClassLoader(); if (classLoader != null) { ois = new CustomObjectInputStream(bis, classLoader); } else { ois = new ObjectInputStream(bis);
if (log.isDebugEnabled()) log.debug("Creating custom object input stream for class loader "); ois = new CustomObjectInputStream(bis, classLoader); } else { if (log.isDebugEnabled())
classLoader = loader.getClassLoader(); if (classLoader != null) ois = new CustomObjectInputStream(bis, classLoader); else ois = new ObjectInputStream(bis);