Package org.apache.catalina

Examples of org.apache.catalina.Loader


     */
    public Session load(String id)
        throws ClassNotFoundException, IOException {
        ResultSet rst = null;
        StandardSession _session = null;
        Loader loader = null;
        ClassLoader classLoader = null;
        ObjectInputStream ois = null;
        BufferedInputStream bis = null;
        Container container = manager.getContainer();
        String loadSql =
            "SELECT " + sessionIdCol + ", " + sessionDataCol + " FROM " +
            sessionTable + " WHERE " + sessionIdCol + " = ? AND " +
            sessionAppCol + " = ?";

        synchronized(this) {
            Connection _conn = getConnection();
            if(_conn == null) {
                return(null);
            }

            try {
                if(preparedLoadSql == null) {
                    preparedLoadSql = _conn.prepareStatement(loadSql);
                }

                preparedLoadSql.setString(1, id);
                preparedLoadSql.setString(2, getName());
                rst = preparedLoadSql.executeQuery();
                if (rst.next()) {
                    bis = new BufferedInputStream(rst.getBinaryStream(2));

                    if (container != null) {
                        loader = container.getLoader();
                    }
                    if (loader != null) {
                        classLoader = loader.getClassLoader();
                    }
                    if (classLoader != null) {
                        ois = new CustomObjectInputStream(bis,
                                                          classLoader);
                    } else {
View Full Code Here


     */
    public void processClusterReceiver() {
        Object[] objs = clusterReceiver.getObjects();
        StandardSession _session = null;
        ByteArrayInputStream bis = null;
        Loader loader = null;
        ClassLoader classLoader = null;
        ObjectInputStream ois = null;
        byte[] buf = new byte[5000];
        ReplicationWrapper repObj = null;

        for(int i=0; i < objs.length;i++) {
            try {
                bis = new ByteArrayInputStream(buf);
                repObj = (ReplicationWrapper)objs[i];
                buf = repObj.getDataStream();
                bis = new ByteArrayInputStream(buf, 0, buf.length);

                if (container != null)
                    loader = container.getLoader();

                if (loader != null)
                    classLoader = loader.getClassLoader();

                if (classLoader != null)
                    ois = new CustomObjectInputStream(bis,
                                                      classLoader);
                else
View Full Code Here

            return;
        if (debug >= 1)
            log(sm.getString("standardManager.loading", pathname));
        FileInputStream fis = null;
        ObjectInputStream ois = null;
        Loader loader = null;
        ClassLoader classLoader = null;
        try {
            fis = new FileInputStream(file.getAbsolutePath());
            BufferedInputStream bis = new BufferedInputStream(fis);
            if (container != null)
                loader = container.getLoader();
            if (loader != null)
                classLoader = loader.getClassLoader();
            if (classLoader != null) {
                if (debug >= 1)
                    log("Creating custom object input stream for class loader "
                        + classLoader);
                ois = new CustomObjectInputStream(bis, classLoader);
View Full Code Here

                throw new ServletException
                    (sm.getString("standardWrapper.notClass", getName()));
            }
   
            // Acquire an instance of the class loader to be used
            Loader loader = getLoader();
            if (loader == null) {
                unavailable(null);
                throw new ServletException
                    (sm.getString("standardWrapper.missingLoader", getName()));
            }
   
            ClassLoader classLoader = loader.getClassLoader();
   
            // Special case class loader for a container provided servlet
            if (isContainerProvidedServlet(actualClass)) {
                classLoader = this.getClass().getClassLoader();
                log(sm.getString
View Full Code Here

     * @param loader The newly associated loader
     */
    public synchronized void setLoader(Loader loader) {

        // Change components if necessary
        Loader oldLoader = this.loader;
        if (oldLoader == loader)
            return;
        this.loader = loader;

        // Stop the old component if necessary
View Full Code Here

     * Set the Loader with which this Context is associated.
     *
     * @param loader The newly associated loader
     */
    public void setLoader(Loader loader) {
        Loader oldLoader = this.loader;
        this.loader = loader;
       
        if (loader != null) {
            loader.setDefaultContext(this);
        }
View Full Code Here

            Class clazz = loader.getClass();
            Class types[] = { ClassLoader.class };
            Object args[] = { parentClassLoader };
            try {
                Constructor constructor = clazz.getDeclaredConstructor(types);
                Loader context_loader = (Loader) constructor.newInstance(args);
                context_loader.setDelegate(loader.getDelegate());
                context_loader.setReloadable(loader.getReloadable());
                if (loader instanceof WebappLoader) {
                    ((WebappLoader)context_loader).setCheckInterval
                        (((WebappLoader)loader).getCheckInterval());
                    ((WebappLoader)context_loader).setDebug
                        (((WebappLoader)loader).getDebug());
View Full Code Here

                (Globals.MBEAN_SERVER_ATTR,
                 MBeanUtils.createServer());
        }

        // Create the MBeans for the associated nested components
        Loader cLoader = context.getLoader();
        if (cLoader != null) {
            if (debug >= 4)
                log("Creating MBean for Loader " + cLoader);
            MBeanUtils.createMBean(cLoader);
        }
View Full Code Here

            log("Creating MBean for DefaultContext " + dcontext);
        MBeanUtils.createMBean(dcontext);
        dcontext.addPropertyChangeListener(this);
       
        // Create the MBeans for the associated nested components
        Loader dLoader = dcontext.getLoader();
        if (dLoader != null) {
            if (debug >= 4)
                log("Creating MBean for Loader " + dLoader);
            MBeanUtils.createMBean(dLoader);
        }
View Full Code Here

        if ((cLogger != null) && (cLogger != hLogger)) {
            if (debug >= 4)
                log("Destroying MBean for Logger " + cLogger);
            MBeanUtils.destroyMBean(cLogger);
        }
        Loader cLoader = context.getLoader();
        if (cLoader != null) {
            if (debug >= 4)
                log("Destroying MBean for Loader " + cLoader);
            MBeanUtils.destroyMBean(cLoader);
        }
View Full Code Here

TOP

Related Classes of org.apache.catalina.Loader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.