You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2002/12/03 14:52:14 UTC

cvs commit: xml-cocoon2/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/components SessionManager.java

cziegeler    2002/12/03 05:52:14

  Modified:    src/blocks/portal-fw/java/org/apache/cocoon/webapps/portal/components
                        PortalManager.java
               src/blocks/session-fw/java/org/apache/cocoon/webapps/session/components
                        SessionManager.java
  Log:
  Changing Exception type
  
  Revision  Changes    Path
  1.5       +5 -5      xml-cocoon2/src/blocks/portal-fw/java/org/apache/cocoon/webapps/portal/components/PortalManager.java
  
  Index: PortalManager.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/portal-fw/java/org/apache/cocoon/webapps/portal/components/PortalManager.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PortalManager.java	21 Nov 2002 18:18:48 -0000	1.4
  +++ PortalManager.java	3 Dec 2002 13:52:13 -0000	1.5
  @@ -1145,24 +1145,24 @@
           try {
               // check parameter
               if (type == null) {
  -                throw new IllegalArgumentException("buildProfile: Type is required");
  +                throw new ProcessingException("buildProfile: Type is required");
               }
               if (type.equals(PortalManager.BUILDTYPE_VALUE_GLOBAL) == true ||
                   type.equals(PortalManager.BUILDTYPE_VALUE_BASIC) == true) {
                   // nothing to do here
               } else if (type.equals(PortalManager.BUILDTYPE_VALUE_ROLE) == true) {
                   if (role == null) {
  -                    throw new IllegalArgumentException("buildProfile: Role is required");
  +                    throw new ProcessingException("buildProfile: Role is required");
                   }
               } else if (type.equals(PortalManager.BUILDTYPE_VALUE_ID) == true) {
                   if (role == null) {
  -                    throw new IllegalArgumentException("buildProfile: Role is required");
  +                    throw new ProcessingException("buildProfile: Role is required");
                   }
                   if (id == null) {
  -                    throw new IllegalArgumentException("buildProfile: ID is required");
  +                    throw new ProcessingException("buildProfile: ID is required");
                   }
               } else {
  -                throw new IllegalArgumentException("buildProfile: Type unknown: " + type);
  +                throw new ProcessingException("buildProfile: Type unknown: " + type);
               }
   
               SessionContext context = this.getContext(true);
  
  
  
  1.4       +35 -32    xml-cocoon2/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/components/SessionManager.java
  
  Index: SessionManager.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/session-fw/java/org/apache/cocoon/webapps/session/components/SessionManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SessionManager.java	21 Nov 2002 18:18:48 -0000	1.3
  +++ SessionManager.java	3 Dec 2002 13:52:14 -0000	1.4
  @@ -369,7 +369,8 @@
        *                   it is set to false, the session is only terminated
        *                   if no session context is available.
        */
  -    public void terminateSession(boolean force) {
  +    public void terminateSession(boolean force) 
  +    throws ProcessingException {
           // synchronized
           if (this.getLogger().isDebugEnabled() == true) {
               this.getLogger().debug("BEGIN terminateSession force="+force);
  @@ -406,10 +407,10 @@
           // test arguments
           Session session = this.getSession(false);
           if (session == null) {
  -            throw new IllegalArgumentException("CreateContext: Session is required");
  +            throw new ProcessingException("CreateContext: Session is required");
           }
           if (name == null) {
  -            throw new IllegalArgumentException("CreateContext: Name is required");
  +            throw new ProcessingException("CreateContext: Name is required");
           }
   
           SessionContext context;
  @@ -451,14 +452,14 @@
   
           // test arguments
           if (name == null) {
  -            throw new IllegalArgumentException("SessionManager.deleteContext: Name is required");
  +            throw new ProcessingException("SessionManager.deleteContext: Name is required");
           }
           if (SessionManager.isReservedContextName(name) == true) {
               throw new ProcessingException("SessionContext with name " + name + " is reserved and cannot be deleted manually.");
           }
           Session session = this.getSession(false);
           if (session == null) {
  -            throw new IllegalArgumentException("SessionManager.deleteContext: Session is required");
  +            throw new ProcessingException("SessionManager.deleteContext: Session is required");
           }
   
           synchronized(session) {
  @@ -494,10 +495,10 @@
   
           // test arguments
           if (contextName == null) {
  -            throw new IllegalArgumentException("SessionManager.getContextFragment: Name is required");
  +            throw new ProcessingException("SessionManager.getContextFragment: Name is required");
           }
           if (path == null) {
  -            throw new IllegalArgumentException("SessionManager.getContextFragment: Path is required");
  +            throw new ProcessingException("SessionManager.getContextFragment: Path is required");
           }
   
           SessionContext context;
  @@ -506,12 +507,12 @@
           } else {
               Session session = this.getSession(false);
               if (session == null) {
  -                throw new IllegalArgumentException("SessionManager.getContextFragment: Session is required for context " + contextName);
  +                throw new ProcessingException("SessionManager.getContextFragment: Session is required for context " + contextName);
               }
               context = this.getContext(contextName);
           }
           if (context == null) {
  -            throw new IllegalArgumentException("SessionManager.getContextFragment: Context '" + contextName + "' not found.");
  +            throw new ProcessingException("SessionManager.getContextFragment: Context '" + contextName + "' not found.");
           }
   
           DocumentFragment frag;
  @@ -546,15 +547,15 @@
   
           // test arguments
           if (contextName == null) {
  -            throw new IllegalArgumentException("SessionManager.streamContextFragment: Name is required");
  +            throw new ProcessingException("SessionManager.streamContextFragment: Name is required");
           }
           if (path == null) {
  -            throw new IllegalArgumentException("SessionManager.streamContextFragment: Path is required");
  +            throw new ProcessingException("SessionManager.streamContextFragment: Path is required");
           }
   
           SessionContext context = this.getContext(contextName);
           if (context == null) {
  -            throw new IllegalArgumentException("SessionManager.streamContextFragment: Context '" + contextName + "' not found.");
  +            throw new ProcessingException("SessionManager.streamContextFragment: Context '" + contextName + "' not found.");
           }
   
           streamed = context.streamXML(path, consumer, consumer);
  @@ -587,13 +588,13 @@
           }
           // test arguments
           if (contextName == null) {
  -            throw new IllegalArgumentException("SessionManager.setContextFragment: Name is required");
  +            throw new ProcessingException("SessionManager.setContextFragment: Name is required");
           }
           if (path == null) {
  -            throw new IllegalArgumentException("SessionManager.setContextFragment: Path is required");
  +            throw new ProcessingException("SessionManager.setContextFragment: Path is required");
           }
           if (fragment == null) {
  -            throw new IllegalArgumentException("SessionManager.setContextFragment: Fragment is required");
  +            throw new ProcessingException("SessionManager.setContextFragment: Fragment is required");
           }
   
           // get context
  @@ -601,7 +602,7 @@
   
           // check context
           if (context == null) {
  -            throw new IllegalArgumentException("SessionManager.setContextFragment: Context '" + contextName + "' not found.");
  +            throw new ProcessingException("SessionManager.setContextFragment: Context '" + contextName + "' not found.");
           }
   
           context.setXML(path, fragment);
  @@ -633,13 +634,13 @@
           }
           // test arguments
           if (contextName == null) {
  -            throw new IllegalArgumentException("SessionManager.appendContextFragment: Name is required");
  +            throw new ProcessingException("SessionManager.appendContextFragment: Name is required");
           }
           if (path == null) {
  -            throw new IllegalArgumentException("SessionManager.appendContextFragment: Path is required");
  +            throw new ProcessingException("SessionManager.appendContextFragment: Path is required");
           }
           if (fragment == null) {
  -            throw new IllegalArgumentException("SessionManager.appendContextFragment: Fragment is required");
  +            throw new ProcessingException("SessionManager.appendContextFragment: Fragment is required");
           }
   
           // get context
  @@ -647,7 +648,7 @@
   
           // check context
           if (context == null) {
  -            throw new IllegalArgumentException("SessionManager.appendContextFragment: Context '" + contextName + "' not found.");
  +            throw new ProcessingException("SessionManager.appendContextFragment: Context '" + contextName + "' not found.");
           }
   
           context.appendXML(path, fragment);
  @@ -679,13 +680,13 @@
   
           // test arguments
           if (contextName == null) {
  -            throw new IllegalArgumentException("SessionManager.mergeContextFragment: Name is required");
  +            throw new ProcessingException("SessionManager.mergeContextFragment: Name is required");
           }
           if (path == null) {
  -            throw new IllegalArgumentException("SessionManager.mergeContextFragment: Path is required");
  +            throw new ProcessingException("SessionManager.mergeContextFragment: Path is required");
           }
           if (fragment == null) {
  -            throw new IllegalArgumentException("SessionManager.mergeContextFragment: Fragment is required");
  +            throw new ProcessingException("SessionManager.mergeContextFragment: Fragment is required");
           }
   
           // get context
  @@ -693,7 +694,7 @@
   
           // check context
           if (context == null) {
  -            throw new IllegalArgumentException("SessionManager.mergeContextFragment: Context '" + contextName + "' not found.");
  +            throw new ProcessingException("SessionManager.mergeContextFragment: Context '" + contextName + "' not found.");
           }
   
           Node contextNode = context.getSingleNode(path);
  @@ -727,10 +728,10 @@
           }
           // test arguments
           if (contextName == null) {
  -            throw new IllegalArgumentException("SessionManager.removeContextFragment: Name is required");
  +            throw new ProcessingException("SessionManager.removeContextFragment: Name is required");
           }
           if (path == null) {
  -            throw new IllegalArgumentException("SessionManager.removeContextFragment: Path is required");
  +            throw new ProcessingException("SessionManager.removeContextFragment: Path is required");
           }
   
           // get context
  @@ -738,7 +739,7 @@
   
           // check context
           if (context == null) {
  -            throw new IllegalArgumentException("SessionManager.removeContextFragment: Context '" + contextName + "' not found.");
  +            throw new ProcessingException("SessionManager.removeContextFragment: Context '" + contextName + "' not found.");
           }
   
           context.removeXML(path);
  @@ -960,7 +961,7 @@
           } else {
               Session session = this.getSession(false);
               if (session == null) {
  -                throw new IllegalArgumentException("SessionManager.getContext: Session is required.");
  +                throw new ProcessingException("SessionManager.getContext: Session is required.");
               }
               synchronized (session) {
                   final Map contexts = this.getSessionContexts();
  @@ -974,10 +975,11 @@
       /**
        * Check if a context exists
        */
  -    public synchronized boolean hasSessionContext() {
  +    public synchronized boolean hasSessionContext() 
  +    throws ProcessingException {
           Session session = this.getSession(false);
           if (session == null) {
  -            throw new IllegalArgumentException("SessionManager.hasSessionContext: Session is required.");
  +            throw new ProcessingException("SessionManager.hasSessionContext: Session is required.");
           }
           synchronized (session) {
               final Map contexts = this.getSessionContexts();
  @@ -990,10 +992,11 @@
        *  If the session context with the given name exists, <CODE>true</CODE> is
        *  returned.
        */
  -    public synchronized boolean existsContext(String name) {
  +    public synchronized boolean existsContext(String name) 
  +    throws ProcessingException {
           Session session = this.getSession(false);
           if (session == null) {
  -            throw new IllegalArgumentException("SessionManager.existsContext: Session is required.");
  +            throw new ProcessingException("SessionManager.existsContext: Session is required.");
           }
           synchronized (session) {
               final Map contexts = this.getSessionContexts();
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org