cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r126535 - in cocoon/trunk/src/blocks/axis/java/org/apache/cocoon: components/axis components/axis/providers reading webservices/system
Date Wed, 26 Jan 2005 19:54:27 GMT
Author: cziegeler
Date: Wed Jan 26 11:54:26 2005
New Revision: 126535

URL: http://svn.apache.org/viewcvs?view=rev&rev=126535
Log:
Format code
Modified:
   cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/SoapServerImpl.java
   cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/providers/AvalonProvider.java
   cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/reading/AxisRPCReader.java
   cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/webservices/system/System.java

Modified: cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/SoapServerImpl.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/SoapServerImpl.java?view=diff&rev=126535&p1=cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/SoapServerImpl.java&r1=126534&p2=cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/SoapServerImpl.java&r2=126535
==============================================================================
--- cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/SoapServerImpl.java
(original)
+++ cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/SoapServerImpl.java
Wed Jan 26 11:54:26 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -91,8 +91,8 @@
  */
 public class SoapServerImpl extends AbstractLogEnabled
     implements SoapServer, Serviceable, Configurable, Contextualizable, Initializable,
-               Startable, ThreadSafe
-{
+               Startable, ThreadSafe {
+
     /**
      * Constant describing the default location of the server configuration file
      */
@@ -124,37 +124,29 @@
     private WSDDDocument[] m_descriptors;
 
     // context reference
-    private Context m_context;
+    private Context context;
 
     // serivce manager reference
-    private ServiceManager m_manager;
+    private ServiceManager manager;
 
-    /**
-     * Contextualize this Reader.
-     *
-     * @param context a <code>Context</code> instance
-     * @exception ContextException if an error occurs
+    /* (non-Javadoc)
+     * @see org.apache.avalon.framework.context.Contextualizable#contextualize(org.apache.avalon.framework.context.Context)
      */
     public void contextualize(final Context context)
-        throws ContextException
-    {
-        m_context = context;
+    throws ContextException {
+        this.context = context;
     }
 
-    /**
-     * Compose this server
-     *
-     * @param manager a <code>ServiceManager</code> value
-     * @exception ServiceException if an error occurs
+    /* (non-Javadoc)
+     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
      */
     public void service(ServiceManager manager)
-        throws ServiceException
-    {
-        m_manager = manager;
+    throws ServiceException {
+        this.manager = manager;
     }
 
     /**
-     * Configures this reader.
+     * Configures this server.
      *
      * <p>
      *  Sets the following optional configuration settings:
@@ -190,8 +182,7 @@
      * @exception ConfigurationException if an error occurs
      */
     public void configure(final Configuration config)
-        throws ConfigurationException
-    {
+    throws ConfigurationException {
         try {
             setServerConfig(config);
             setAttachmentDir(config);
@@ -215,22 +206,18 @@
      * @exception Exception if an error occurs
      */
     public void setServerConfig(final Configuration config)
-        throws Exception
-    {
+    throws Exception {
         final Configuration wsdd = config.getChild("server-wsdd");
         SourceResolver resolver = null;
 
-        try
-        {
-            resolver = (SourceResolver) m_manager.lookup(SourceResolver.ROLE);
+        try {
+            resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
             m_serverWSDD =
                 resolver.resolveURI(
                     wsdd.getAttribute("src", DEFAULT_SERVER_CONFIG)
                 );
-        }
-        finally
-        {
-            if (resolver != null) m_manager.release(resolver);
+        } finally {
+            this.manager.release(resolver);
         }
     }
 
@@ -243,22 +230,19 @@
      * @exception ContextException if a context error occurs
      */
     private void setAttachmentDir(final Configuration config)
-        throws ConfigurationException, ContextException
-    {
+    throws ConfigurationException, ContextException {
         final Configuration dir = config.getChild("attachment-dir");
         m_attachmentDir = dir.getAttribute("src", null);
 
-        if (m_attachmentDir == null)
-        {
+        if (m_attachmentDir == null) {
             File workDir =
-                (File) m_context.get(org.apache.cocoon.Constants.CONTEXT_WORK_DIR);
+                (File) this.context.get(org.apache.cocoon.Constants.CONTEXT_WORK_DIR);
             File attachmentDir =
                 IOUtils.createFile(workDir, "attachments" + File.separator);
             m_attachmentDir = IOUtils.getFullFilename(attachmentDir);
         }
 
-        if (getLogger().isDebugEnabled())
-        {
+        if (getLogger().isDebugEnabled()) {
             getLogger().debug("attachment directory = " + m_attachmentDir);
         }
     }
@@ -272,22 +256,19 @@
      * @exception ContextException if a context error occurs
      */
     private void setJWSDir(final Configuration config)
-        throws ConfigurationException, ContextException
-    {
+    throws ConfigurationException, ContextException {
         final Configuration dir = config.getChild("jws-dir");
         m_jwsClassDir = dir.getAttribute("src", null);
 
-        if (m_jwsClassDir == null)
-        {
+        if (m_jwsClassDir == null) {
             File workDir =
-                (File) m_context.get(org.apache.cocoon.Constants.CONTEXT_WORK_DIR);
+                (File) this.context.get(org.apache.cocoon.Constants.CONTEXT_WORK_DIR);
             File jwsClassDir =
                 IOUtils.createFile(workDir, "axis-jws" + File.separator);
             m_jwsClassDir = IOUtils.getFullFilename(jwsClassDir);
         }
 
-        if (getLogger().isDebugEnabled())
-        {
+        if (getLogger().isDebugEnabled()) {
             getLogger().debug("jws class directory = " + m_jwsClassDir);
         }
     }
@@ -299,22 +280,20 @@
      * @exception ConfigurationException if an error occurs
      */
     private void setSecurityProvider(final Configuration config)
-        throws ConfigurationException
-    {
+    throws ConfigurationException {
         final Configuration secProvider =
             config.getChild("security-provider", false);
 
-        if (secProvider != null)
-        {
+        if (secProvider != null) {
             final String attr = secProvider.getAttribute("enabled");
             final boolean providerIsEnabled = BooleanUtils.toBoolean(attr);
 
-            if (providerIsEnabled)
+            if (providerIsEnabled) {
                 m_securityProvider = new ServletSecurityProvider();
+            }
         }
 
-        if (getLogger().isDebugEnabled())
-        {
+        if (getLogger().isDebugEnabled()) {
             getLogger().debug("security provider = " + m_securityProvider);
         }
     }
@@ -326,8 +305,7 @@
      * @exception ConfigurationException if an error occurs
      */
     private void setTransportName(final Configuration config)
-        throws ConfigurationException
-    {
+    throws ConfigurationException {
         final Configuration name = config.getChild("transport");
         m_transportName =
             name.getAttribute("name", HTTPTransport.DEFAULT_TRANSPORT_NAME);
@@ -342,24 +320,20 @@
      * @exception Exception if an error occurs
      */
     private void setManagedServices(final Configuration config)
-        throws Exception
-    {
+    throws Exception {
         final Configuration m = config.getChild("managed-services", false);
         final List descriptors = new ArrayList();
 
-        if (m != null)
-        {
+        if (m != null) {
             SourceResolver resolver = null;
             DOMParser parser = null;
 
-            try
-            {
+            try {
                 final Configuration[] services = m.getChildren("descriptor");
-                resolver = (SourceResolver) m_manager.lookup(SourceResolver.ROLE);
-                parser = (DOMParser) m_manager.lookup(DOMParser.ROLE);
+                resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
+                parser = (DOMParser) this.manager.lookup(DOMParser.ROLE);
 
-                for (int i = 0; i < services.length; ++i)
-                {
+                for (int i = 0; i < services.length; ++i) {
                     final String location = services[i].getAttribute("src");
                     Source source = resolver.resolveURI(location);
 
@@ -372,11 +346,9 @@
 
                     descriptors.add(new WSDDDocument(d));
                 }
-            }
-            finally
-            {
-                if (resolver != null) m_manager.release(resolver);
-                if (parser != null) m_manager.release(parser);
+            } finally {
+                this.manager.release(resolver);
+                this.manager.release(parser);
             }
         }
 
@@ -385,39 +357,32 @@
             (WSDDDocument[]) descriptors.toArray(new WSDDDocument[]{});
     }
 
-    /**
-     * Initialize this reader, creates AXIS server engine.
-     *
-     * @exception Exception if an error occurs
+    /* (non-Javadoc)
+     * @see org.apache.avalon.framework.activity.Initializable#initialize()
      */
     public void initialize()
-        throws Exception
-    {
+    throws Exception {
         m_axisServer = createEngine();
 
-        if (getLogger().isDebugEnabled())
-        {
+        if (getLogger().isDebugEnabled()) {
             getLogger().debug("SoapServerImpl.initialize() complete");
         }
     }
 
     /**
-     * Starts this reader. Deploys all managed services as specified at
+     * Starts this server. Deploys all managed services as specified at
      * configuration time.
      *
      * @exception Exception if an error occurs
      */
     public void start()
-        throws Exception
-    {
+    throws Exception {
         // deploy all configured services
-        for (int i = 0; i < m_descriptors.length; ++i)
-        {
+        for (int i = 0; i < m_descriptors.length; ++i) {
             WSDDDeployment deployment = m_engineConfig.getDeployment();
             m_descriptors[i].deploy(deployment);
 
-            if (getLogger().isDebugEnabled())
-            {
+            if (getLogger().isDebugEnabled()) {
                 getLogger().debug(
                     "Deployed Descriptor:\n" +
                     XMLUtils.DocumentToString(m_descriptors[i].getDOMDocument())
@@ -425,8 +390,7 @@
             }
         }
 
-        if (getLogger().isDebugEnabled())
-        {
+        if (getLogger().isDebugEnabled()) {
             getLogger().debug("SoapServerImpl.start() complete");
         }
     }
@@ -439,31 +403,29 @@
      * @exception Exception if an error occurs
      */
     public void stop()
-        throws Exception
-    {
+    throws Exception {
         WSDDDeployment deployment = m_engineConfig.getDeployment();
         WSDDService[] services = deployment.getServices();
 
         // undeploy all deployed services
-        for (int i = 0; i < services.length; ++i)
-        {
+        for (int i = 0; i < services.length; ++i) {
             deployment.undeployService(services[i].getQName());
 
-            if (getLogger().isDebugEnabled())
-            {
+            if (getLogger().isDebugEnabled()) {
                 getLogger().debug("Undeployed: " + services[i].toString());
             }
         }
 
-        if (getLogger().isDebugEnabled())
-        {
+        if (getLogger().isDebugEnabled()) {
             getLogger().debug("SoapServerImpl.stop() complete");
         }
     }
 
+    /* (non-Javadoc)
+     * @see org.apache.cocoon.components.axis.SoapServer#invoke(org.apache.axis.MessageContext)
+     */
     public void invoke(MessageContext message)
-        throws Exception
-    {
+    throws Exception {
         m_axisServer.invoke(message);
     }
 
@@ -477,9 +439,8 @@
     public MessageContext createMessageContext(
         HttpServletRequest req,
         HttpServletResponse res,
-        ServletContext con
-    )
-    {
+        ServletContext con) {
+
         MessageContext msgContext = new MessageContext(m_axisServer);
         String webInfPath = con.getRealPath("/WEB-INF");
         String homeDir = con.getRealPath("/");
@@ -489,7 +450,7 @@
 
         // Add Avalon specifics to MessageContext
         msgContext.setProperty(LOGGER, getLogger());
-        msgContext.setProperty(AvalonProvider.SERVICE_MANAGER, m_manager);
+        msgContext.setProperty(AvalonProvider.SERVICE_MANAGER, this.manager);
 
         // Save some HTTP specific info in the bag in case someone needs it
         msgContext.setProperty(Constants.MC_JWS_CLASSDIR, m_jwsClassDir);
@@ -513,19 +474,18 @@
         // Save the real path
         String realpath = con.getRealPath(req.getServletPath());
 
-        if (realpath != null)
-        {
+        if (realpath != null) {
             msgContext.setProperty(Constants.MC_REALPATH, realpath);
         }
 
         msgContext.setProperty(Constants.MC_CONFIGPATH, webInfPath);
 
-        if (m_securityProvider != null)
+        if (m_securityProvider != null) {
             msgContext.setProperty("securityProvider", m_securityProvider);
+        }
 
         // write out the contents of the message context for debugging purposes
-        if (getLogger().isDebugEnabled())
-        {
+        if (getLogger().isDebugEnabled()) {
             debugMessageContext(msgContext);
         }
 
@@ -537,12 +497,8 @@
      *
      * @param context a <code>MessageContext</code> instance
      */
-    private void debugMessageContext(final MessageContext context)
-    {
-        for (final Iterator i = context.getPropertyNames();
-             i.hasNext();
-        )
-        {
+    private void debugMessageContext(final MessageContext context) {
+        for (final Iterator i = context.getPropertyNames(); i.hasNext(); ) {
             final String key = (String) i.next();
             getLogger().debug(
                 "MessageContext: Key:" + key + ": Value: " + context.getProperty(key)
@@ -556,12 +512,10 @@
      * context.
      */
     public AxisServer createEngine()
-        throws Exception
-    {
+    throws Exception {
         AxisServer engine = AxisServer.getServer(getEngineEnvironment());
 
-        if (getLogger().isDebugEnabled())
-        {
+        if (getLogger().isDebugEnabled()) {
             getLogger().debug("Axis engine created");
         }
 
@@ -569,8 +523,7 @@
     }
 
     protected Map getEngineEnvironment()
-        throws Exception
-    {
+    throws Exception  {
         Map env = new HashMap();
 
         // use FileProvider directly with a Avalon Source object instead of going
@@ -584,33 +537,4 @@
 
         return env;
     }
-
-    /*
-     * Helper method to convert a <code>Message</code> structure
-     * into a <code>String</code>.
-     *
-     * @param msg a <code>Message</code> value
-     * @return a <code>String</code> value
-     */
-    /* FIXME (SM): this method appears to be unused, should we remove it?
-    private String messageToString(final Message msg)
-    {
-        try
-        {
-            OutputStream os = new ByteArrayOutputStream();
-            msg.writeTo(os);
-            return os.toString();
-        }
-        catch (Exception e)
-        {
-            if (getLogger().isWarnEnabled())
-            {
-                getLogger().warn(
-                    "Warning, could not convert message (" + msg + ") into string", e
-                );
-            }
-
-            return null;
-        }
-    } */
 }

Modified: cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/providers/AvalonProvider.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/providers/AvalonProvider.java?view=diff&rev=126535&p1=cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/providers/AvalonProvider.java&r1=126534&p2=cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/providers/AvalonProvider.java&r2=126535
==============================================================================
--- cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/providers/AvalonProvider.java
(original)
+++ cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/components/axis/providers/AvalonProvider.java
Wed Jan 26 11:54:26 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -108,16 +108,14 @@
      * @return an object that implements the service
      * @exception Exception if an error occurs
      */
-    protected Object makeNewServiceObject(
-        MessageContext msgContext, String role
-    )
-        throws Exception
-    {
+    protected Object makeNewServiceObject(MessageContext msgContext, String role)
+    throws Exception {
         ServiceManager manager =
             (ServiceManager) msgContext.getProperty(SERVICE_MANAGER);
 
-        if (manager == null)
+        if (manager == null) {
             throw new AxisFault("Could not access Avalon ServiceManager");
+        }
 
         return decorate(manager.lookup(role), manager);
     }
@@ -171,29 +169,20 @@
      * @exception AxisFault if an error occurs
      */
     protected Class getServiceClass(
-        String role, SOAPService service, MessageContext msgContext
-    )
-        throws AxisFault
-    {
+        String role, SOAPService service, MessageContext msgContext )
+    throws AxisFault {
         // Assuming CocoonServiceManager semantics the ROLE name is
         // actually the class name, potentially with a variant following
         // the class name with a '/' separator
 
-        try
-        {
+        try {
             int i;
 
-            if ((i = role.indexOf('/')) != -1)
-            {
+            if ((i = role.indexOf('/')) != -1) {
                 return Class.forName(role.substring(0, i));
-            }
-            else
-            {
-                return Class.forName(role);
-            }
-        }
-        catch (ClassNotFoundException e)
-        {
+            } 
+            return Class.forName(role);
+        } catch (ClassNotFoundException e) {
             throw new AxisFault("Couldn't create class object for role " + role, e);
         }
     }
@@ -230,8 +219,8 @@
      *  on the scope of the service (ie. Request, Session & Application).
      * </p>
      */
-    final class Handler implements InvocationHandler
-    {
+    final class Handler implements InvocationHandler {
+        
         // Constants describing the ServiceLifecycle.destroy method
         private final String SL_DESTROY = "destroy";
         private final Class  SL_CLASS = ServiceLifecycle.class;
@@ -246,8 +235,7 @@
          * @param object a <code>Component</code> instance
          * @param manager a <code>ServiceManager</code> instance
          */
-        public Handler(final Object object, final ServiceManager manager)
-        {
+        public Handler(final Object object, final ServiceManager manager) {
             m_object = object;
             m_manager = manager;
         }
@@ -270,22 +258,17 @@
          * @exception Throwable if an error occurs
          */
         public Object invoke(Object proxy, Method method, Object[] args)
-            throws Throwable
-        {
+        throws Throwable {
             // if ServiceLifecycle.destroy() called, return to CM
-            if (method.getDeclaringClass().equals(SL_CLASS))
-            {
-                if (method.getName().equals(SL_DESTROY))
-                {
+            if (method.getDeclaringClass().equals(SL_CLASS)) {
+                if (method.getName().equals(SL_DESTROY)) {
                     m_manager.release(m_object);
                 }
 
                 return null;
-            }
-            else // otherwise pass call to the real object
-            {
-                return method.invoke(m_object, args);
-            }
+            } 
+            // otherwise pass call to the real object
+            return method.invoke(m_object, args);
         }
     }
 }

Modified: cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/reading/AxisRPCReader.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/reading/AxisRPCReader.java?view=diff&rev=126535&p1=cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/reading/AxisRPCReader.java&r1=126534&p2=cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/reading/AxisRPCReader.java&r2=126535
==============================================================================
--- cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/reading/AxisRPCReader.java	(original)
+++ cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/reading/AxisRPCReader.java	Wed Jan
26 11:54:26 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -93,6 +93,9 @@
         m_isDevelompent = config.getChild("development-stage").getValueAsBoolean(m_isDevelompent
);
     }
     
+    /* (non-Javadoc)
+     * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager)
+     */
     public void service(final ServiceManager manager) throws ServiceException {
         super.service(manager);
         // set soap server reference
@@ -121,16 +124,13 @@
         final SourceResolver resolver,
         final Map objectModel,
         final String src,
-        final Parameters parameters
-    )
-        throws ProcessingException, IOException, SAXException
-    {
+        final Parameters parameters)
+    throws ProcessingException, IOException, SAXException {
         super.setup(resolver, objectModel, src, parameters);
 
         checkHTTPPost(objectModel);
 
-        if (getLogger().isDebugEnabled())
-        {
+        if (getLogger().isDebugEnabled()) {
             getLogger().debug("AxisRPCReader.setup() complete");
         }
     }
@@ -142,8 +142,7 @@
      * @exception ProcessingException if a non HTTP-POST request has been made.
      */
     private void checkHTTPPost(final Map objectModel)
-        throws ProcessingException
-    {
+    throws ProcessingException {
         String method = ObjectModelHelper.getRequest(objectModel).getMethod();
 
         if (!"POST".equalsIgnoreCase(method))
@@ -165,8 +164,7 @@
      * @exception ProcessingException if a processing error occurs
      */
     public void generate()
-        throws IOException, SAXException, ProcessingException
-    {
+    throws IOException, SAXException, ProcessingException {
         HttpServletRequest req =
             (HttpServletRequest) objectModel.get(HttpEnvironment.HTTP_REQUEST_OBJECT);
         HttpServletResponse res =
@@ -178,8 +176,7 @@
         MessageContext msgContext = null;
         Message responseMsg = null;
 
-        try
-        {
+        try {
             res.setBufferSize(1024 * 8); // provide performance boost.
 
             // Get message context w/ various properties set
@@ -193,8 +190,7 @@
                     req.getHeader(HTTPConstants.HEADER_CONTENT_LOCATION)
                 );
 
-            if (getLogger().isDebugEnabled())
-            {
+            if (getLogger().isDebugEnabled()) {
                 getLogger().debug("Request message:\n" + messageToString(requestMsg));
             }
 
@@ -203,8 +199,7 @@
             String url = req.getRequestURL().toString(); 
             msgContext.setProperty(MessageContext.TRANS_URL, url);
 
-            try
-            {
+            try {
                 //
                 // Save the SOAPAction header in the MessageContext bag.
                 // This will be used to tell the Axis Engine which service
@@ -216,8 +211,7 @@
                 //
                 soapAction = getSoapAction(req);
 
-                if (soapAction != null)
-                {
+                if (soapAction != null) {
                     msgContext.setUseSOAPAction(true);
                     msgContext.setSOAPActionURI(soapAction);
                 }
@@ -226,15 +220,13 @@
                 msgContext.setSession(new AxisHttpSession(req));
 
                 // Invoke the Axis engine...
-                if(getLogger().isDebugEnabled())
-                {
+                if(getLogger().isDebugEnabled()) {
                     getLogger().debug("Invoking Axis Engine");
                 }
 
                 m_server.invoke(msgContext);
 
-                if(getLogger().isDebugEnabled())
-                {
+                if(getLogger().isDebugEnabled()) {
                     getLogger().debug("Return from Axis Engine");
                 }
 
@@ -243,11 +235,8 @@
                     //tell everyone that something is wrong
                     throw new Exception("no response message");
                 }
-            }
-            catch (AxisFault fault)
-            {
-                if (getLogger().isErrorEnabled())
-                {
+            } catch (AxisFault fault) {
+                if (getLogger().isErrorEnabled()) {
                     getLogger().error("Axis Fault", fault);
                 }
 
@@ -258,14 +247,11 @@
                 if (responseMsg == null) {
                     responseMsg = new Message(fault);
                 }
-            }
-            catch (Exception e)
-            {
+            } catch (Exception e) {
                 //other exceptions are internal trouble
                 responseMsg = msgContext.getResponseMessage();
                 res.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-                if (getLogger().isErrorEnabled())
-                {
+                if (getLogger().isErrorEnabled()) {
                     getLogger().error("Error during SOAP call", e);
                 }
                 if (responseMsg == null) {
@@ -274,11 +260,8 @@
                     responseMsg = new Message(fault);
                 }
             }
-        }
-        catch (AxisFault fault)
-        {
-            if (getLogger().isErrorEnabled())
-            {
+        } catch (AxisFault fault) {
+            if (getLogger().isErrorEnabled()) {
                 getLogger().error("Axis fault occured while perforing request", fault);
             }
             processAxisFault(fault);
@@ -287,25 +270,20 @@
             if( responseMsg == null) {
                 responseMsg = new Message(fault);
             }
-        }
-        catch (Exception e)
-        {
+        } catch (Exception e) {
             throw new ProcessingException("Exception thrown while performing request", e);
         }
 
         // Send response back
-        if (responseMsg != null)
-        {
-            if (getLogger().isDebugEnabled())
-            {
+        if (responseMsg != null) {
+            if (getLogger().isDebugEnabled()) {
                 getLogger().debug("Sending response:\n" + messageToString(responseMsg));
             }
 
             sendResponse(getProtocolVersion(req), msgContext.getSOAPConstants(), res, responseMsg);
         }
 
-        if (getLogger().isDebugEnabled())
-        {
+        if (getLogger().isDebugEnabled()) {
             getLogger().debug("AxisRPCReader.generate() complete");
         }
     }
@@ -349,7 +327,7 @@
         if (status == HttpServletResponse.SC_UNAUTHORIZED) {
             // unauth access results in authentication request
             // TODO: less generic realm choice?
-          response.setHeader("WWW-Authenticate","Basic realm=\"AXIS\"");
+            response.setHeader("WWW-Authenticate","Basic realm=\"AXIS\"");
         }
         response.setStatus(status);
     }
@@ -360,8 +338,7 @@
      * @param af Axis Fault
      * @return HTTP Status code.
      */
-    protected int getHttpServletResponseStatus(AxisFault af)
-    {
+    protected int getHttpServletResponseStatus(AxisFault af) {
         // This will raise a 401 for both "Unauthenticated" & "Unauthorized"...
         return af.getFaultCode().getLocalPart().startsWith("Server.Unauth")
                    ? HttpServletResponse.SC_UNAUTHORIZED
@@ -381,40 +358,29 @@
         final String clientVersion,
         final SOAPConstants constants,
         final HttpServletResponse res,
-        final Message responseMsg
-    )
-        throws AxisFault, IOException
-    {
-        if (responseMsg == null)
-        {
+        final Message responseMsg)
+    throws AxisFault, IOException {
+        if (responseMsg == null) {
             res.setStatus(HttpServletResponse.SC_NO_CONTENT);
 
-            if (getLogger().isDebugEnabled())
-            {
+            if (getLogger().isDebugEnabled()) {
                 getLogger().debug("No axis response, not sending one");
             }
-        }
-        else
-        {
-            if (getLogger().isDebugEnabled())
-            {
+        } else {
+            if (getLogger().isDebugEnabled()) {
                 getLogger().debug("Returned Content-Type:" + responseMsg.getContentType(constants));
                 getLogger().debug("Returned Content-Length:" + responseMsg.getContentLength());
             }
 
-            try
-            {
+            try {
                 res.setContentType(responseMsg.getContentType(constants));
                 responseMsg.writeTo(res.getOutputStream());
-            }
-            catch (SOAPException e)
-            {
+            } catch (SOAPException e) {
                 getLogger().error("Exception sending response", e);
             }
         }
 
-        if (!res.isCommitted())
-        {
+        if (!res.isCommitted()) {
             res.flushBuffer(); // Force it right now.
         }
     }
@@ -428,12 +394,10 @@
      * @throws AxisFault
      */
     private String getSoapAction(HttpServletRequest req)
-        throws AxisFault
-    {
+    throws AxisFault {
         String soapAction = req.getHeader(HTTPConstants.HEADER_SOAP_ACTION);
 
-        if (getLogger().isDebugEnabled())
-        {
+        if (getLogger().isDebugEnabled()) {
             getLogger().debug("HEADER_SOAP_ACTION:" + soapAction);
         }
 
@@ -441,8 +405,7 @@
         // Technically, if we don't find this header, we should probably fault.
         // It's required in the SOAP HTTP binding.
         //
-        if (soapAction == null)
-        {
+        if (soapAction == null) {
             throw new AxisFault(
                       "Client.NoSOAPAction",
                       "No SOAPAction header",
@@ -460,7 +423,7 @@
      * Return the HTTP protocol level 1.1 or 1.0
      * by derived class.
      */
-    private String getProtocolVersion(HttpServletRequest req){
+    private String getProtocolVersion(HttpServletRequest req) {
         String ret = HTTPConstants.HEADER_PROTOCOL_V10;
         String prot = req.getProtocol();
         if (prot!= null) {
@@ -482,18 +445,13 @@
      * @param msg a <code>Message</code> value
      * @return a <code>String</code> value
      */
-    private String messageToString(final Message msg)
-    {
-        try
-        {
+    private String messageToString(final Message msg) {
+        try {
             OutputStream os = new ByteArrayOutputStream();
             msg.writeTo(os);
             return os.toString();
-        }
-        catch (Exception e)
-        {
-            if (getLogger().isWarnEnabled())
-            {
+        } catch (Exception e) {
+            if (getLogger().isWarnEnabled()) {
                 getLogger().warn(
                     "Warning, could not convert message (" + msg + ") into string", e
                 );
@@ -506,8 +464,7 @@
     /**
      * Dispose this reader. Release all held resources.
      */
-    public void dispose()
-    {
+    public void dispose() {
         manager.release(m_server);
     }
 }

Modified: cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/webservices/system/System.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/webservices/system/System.java?view=diff&rev=126535&p1=cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/webservices/system/System.java&r1=126534&p2=cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/webservices/system/System.java&r2=126535
==============================================================================
--- cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/webservices/system/System.java	(original)
+++ cocoon/trunk/src/blocks/axis/java/org/apache/cocoon/webservices/system/System.java	Wed
Jan 26 11:54:26 2005
@@ -16,7 +16,6 @@
 package org.apache.cocoon.webservices.system;
 
 import java.util.Properties;
-
 import org.apache.commons.lang.SystemUtils;
 
 /**

Mime
View raw message