Package org.apache.tomcat

Examples of org.apache.tomcat.LifecycleException


     */
    public void start() throws LifecycleException {

  // Validate and update our current component state
  if (started)
      throw new LifecycleException
    (sm.getString("standardManager.alreadyStarted"));
  started = true;

  // Load any previously persisted sessions
  load();
View Full Code Here


     */
    public void stop() throws LifecycleException {

  // Validate and update our current component state
  if (!started)
      throw new LifecycleException
    (sm.getString("standardManager.notStarted"));
  started = false;

  // Stop the background reaper thread
  threadStop();
View Full Code Here

    } catch (IOException f) {
        ;
    }
    ois = null;
      }
      throw new LifecycleException("load/open: IOException", e);
  }

  // Load the previously unloaded active sessions
  synchronized (sessions) {
      try {
    Integer count = (Integer) ois.readObject();
    int n = count.intValue();
    for (int i = 0; i < n; i++) {
        Session session = (Session) ois.readObject();
        sessions.put(session.getId(), session);
    }
      } catch (ClassNotFoundException e) {
    if (ois != null) {
        try {
      ois.close();
        } catch (IOException f) {
      ;
        }
        ois = null;
    }
    throw new LifecycleException
        ("load/read: ClassNotFoundException", e);
      } catch (IOException e) {
    if (ois != null) {
        try {
      ois.close();
        } catch (IOException f) {
      ;
        }
        ois = null;
    }
    throw new LifecycleException("load/read: IOException", e);
      }
  }

  // Close the input stream
  try {
View Full Code Here

    } catch (IOException f) {
        ;
    }
    oos = null;
      }
      throw new LifecycleException("unload/open: IOException", e);
  }

  // Write the number of active sessions, followed by the details
  synchronized (sessions) {
      try {
    oos.writeObject(new Integer(sessions.size()));
    Enumeration elements = sessions.elements();
    while (elements.hasMoreElements()) {
        Session session = (Session) elements.nextElement();
        oos.writeObject(session);
    }
      } catch (IOException e) {
    if (oos != null) {
        try {
      oos.close();
        } catch (IOException f) {
      ;
        }
        oos = null;
    }
    throw new LifecycleException("unload/write: IOException", e);
      }
  }

  // Flush and close the output stream
  try {
      oos.flush();
      oos.close();
      oos = null;
  } catch (IOException e) {
      if (oos != null) {
    try {
        oos.close();
    } catch (IOException f) {
        ;
    }
    oos = null;
      }
      throw new LifecycleException("unload/close: IOException", e);
  }

    }
View Full Code Here

     */
    public void start() throws LifecycleException {

  // Validate and update our current component state
  if (started)
      throw new LifecycleException
    (sm.getString("fileStore.alreadyStarted"));
  started = true;

  // Start the background reaper thread
  threadStart();
View Full Code Here

     */
    public void stop() throws LifecycleException {

  // Validate and update our current component state
  if (!started)
      throw new LifecycleException
    (sm.getString("fileStore.notStarted"));
  started = false;

  // Stop the background reaper thread
  threadStop();
View Full Code Here

     */
    public void start() throws LifecycleException {

  // Validate and update our current component state
  if (started)
      throw new LifecycleException
    (sm.getString("standardLoader.alreadyStarted"));
  started = true;

  // Validate the specified repositories
  Vector files = new Vector();
  Enumeration names = repositories.elements();
  while (names.hasMoreElements()) {
      File file = new File((String) names.nextElement());
      files.addElement(file);
      String path = null;
      try {
    path = file.getCanonicalPath();
      } catch (IOException e) {
    path = "UNKNOWN";
      }
      if (!file.exists())
    throw new LifecycleException
        (sm.getString("standardLoader.exists", path));
      else if (!file.canRead())
    throw new LifecycleException
        (sm.getString("standardLoader.read", path));
      else if (!checkType(file))
    throw new LifecycleException
        (sm.getString("standardLoader.type", path));
  }

  // Construct a new class loader instance for our use
  try {
      classLoader = new AdaptiveClassLoader(files);
  } catch (IllegalArgumentException e) {
      throw new LifecycleException("start: ", e);
  }

    }
View Full Code Here

     */
    public void stop() throws LifecycleException {

  // Validate and update our current component state
  if (!started)
      throw new LifecycleException
    (sm.getString("standardLoader.notStarted"));
  started = false;

  // Throw away our current class loader
  classLoader = null;
View Full Code Here

     */
    public void start() throws LifecycleException {

  // Validate and update our current component state
  if (started)
      throw new LifecycleException
    (sm.getString("fileLogger.alreadyStarted"));
  started = true;

    }
View Full Code Here

     */
    public void stop() throws LifecycleException {

  // Validate and update our current component state
  if (!started)
      throw new LifecycleException
    (sm.getString("fileLogger.notStarted"));
  started = false;

  close();

View Full Code Here

TOP

Related Classes of org.apache.tomcat.LifecycleException

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.