org.apache.axis2.deployment.util
Class Utils

java.lang.Object
  extended by org.apache.axis2.deployment.util.Utils

public class Utils
extends Object


Field Summary
static String defaultEncoding
           
 
Constructor Summary
Utils()
           
 
Method Summary
static void addEndpointsToService(AxisService axisService)
           
static void addEndpointsToService(AxisService axisService, AxisConfiguration axisConfiguration)
           
static void addExcludeMethods(ArrayList excludeList)
          Add the Axis2 lifecycle / session methods to a pre-existing list of names that will be excluded when generating schemas.
static void addFlowHandlers(Flow flow, ClassLoader clsLoader)
           
static void addHttpEndpoint(AxisService axisService, URL url)
           
static void addSoap11Endpoint(AxisService axisService, URL url)
           
static void addSoap12Endpoint(AxisService axisService, URL url)
           
static ClassLoader createClassLoader(ArrayList urls, ClassLoader serviceClassLoader, boolean extractJars, File tmpDir)
           
static DeploymentClassLoader createClassLoader(File serviceFile)
           
static ClassLoader createClassLoader(URL[] urls, ClassLoader serviceClassLoader, boolean extractJars, File tmpDir)
           
static File createTempFile(String suffix, InputStream in, File tmpDir)
           
static void deployModuleServices(AxisModule module, ConfigurationContext configCtx)
          Modules can contain services in some cases.
static void fillAxisService(AxisService axisService, AxisConfiguration axisConfig, ArrayList excludeOperations, ArrayList nonRpcMethods)
          This guy will create a AxisService using java reflection
static List findLibJars(URL url)
          Get names of all *.jar files inside the lib/ directory of a given jar URL
static String getAnnotatedServiceName(Class serviceClass, WebService serviceAnnotation)
          The util method to prepare the JSR 181 annotated service name from given annotation or for defaults JSR 181 specifies that the in javax.jws.WebService the parameter serviceName contains the wsdl:service name to mapp.
static AxisOperation getAxisOperationForJmethod(Method method)
           
static AxisBindingMessage getBindingMessage(AxisBindingOperation bindingOperation, AxisMessage message)
           
static AxisBindingOperation getBindingOperation(AxisBinding binding, AxisOperation operation)
           
static ClassLoader getClassLoader(ClassLoader parent, File file)
          Get a ClassLoader which contains a classpath of a) the passed directory and b) any jar files inside the "lib/" or "Lib/" subdirectory of the passed directory.
static ClassLoader getClassLoader(ClassLoader parent, String path)
           
static AxisBinding getHttpBinding(AxisService service)
           
static org.apache.axiom.om.OMElement getParameter(String name, String value, boolean locked)
           
static String getPath(String parent, String childPath)
           
static String getShortFileName(String filename)
           
static AxisBinding getSoap11Binding(AxisService service)
           
static AxisBinding getSoap12Binding(AxisService service)
           
static URL[] getURLsForAllJars(URL url, File tmpDir)
           
static boolean isHttpBinding(AxisBinding binding)
           
static boolean isSoap11Binding(AxisBinding binding)
           
static boolean isSoap12Binding(AxisBinding binding)
           
static boolean loadHandler(ClassLoader loader1, HandlerDescription desc)
           
static String normalize(String uri)
          Normalize a uri containing ../ and ./ paths.
static void processBeanPropertyExclude(AxisService service)
          This method is to process bean exclude parameter and the XML format of that would be +
static void processPolicyAttachments(Iterator attachmentElements, AxisService service)
           
static File toFile(URL url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultEncoding

public static String defaultEncoding
Constructor Detail

Utils

public Utils()
Method Detail

addFlowHandlers

public static void addFlowHandlers(Flow flow,
                                   ClassLoader clsLoader)
                            throws AxisFault
Throws:
AxisFault

loadHandler

public static boolean loadHandler(ClassLoader loader1,
                                  HandlerDescription desc)
                           throws DeploymentException
Throws:
DeploymentException

getURLsForAllJars

public static URL[] getURLsForAllJars(URL url,
                                      File tmpDir)

createTempFile

public static File createTempFile(String suffix,
                                  InputStream in,
                                  File tmpDir)
                           throws IOException
Throws:
IOException

getClassLoader

public static ClassLoader getClassLoader(ClassLoader parent,
                                         String path)
                                  throws DeploymentException
Throws:
DeploymentException

getClassLoader

public static ClassLoader getClassLoader(ClassLoader parent,
                                         File file)
                                  throws DeploymentException
Get a ClassLoader which contains a classpath of a) the passed directory and b) any jar files inside the "lib/" or "Lib/" subdirectory of the passed directory.

Parameters:
parent - parent ClassLoader which will be the parent of the result of this method
file - a File which must be a directory for this to be useful
Returns:
a new ClassLoader pointing to both the passed dir and jar files under lib/
Throws:
DeploymentException - if problems occur

fillAxisService

public static void fillAxisService(AxisService axisService,
                                   AxisConfiguration axisConfig,
                                   ArrayList excludeOperations,
                                   ArrayList nonRpcMethods)
                            throws Exception
This guy will create a AxisService using java reflection

Parameters:
axisService - the target AxisService
axisConfig - the in-scope AxisConfiguration
excludeOperations - a List of Strings (or null), each containing a method to exclude
nonRpcMethods - a List of Strings (or null), each containing a non-rpc method name
Throws:
Exception - if a problem occurs

getAxisOperationForJmethod

public static AxisOperation getAxisOperationForJmethod(Method method)
                                                throws AxisFault
Throws:
AxisFault

getParameter

public static org.apache.axiom.om.OMElement getParameter(String name,
                                                         String value,
                                                         boolean locked)

deployModuleServices

public static void deployModuleServices(AxisModule module,
                                        ConfigurationContext configCtx)
                                 throws AxisFault
Modules can contain services in some cases. This method will deploy all the services for a given AxisModule into the current AxisConfiguration.

The code looks for an "aars/" directory inside the module (either .mar or exploded), and an "aars.list" file inside that to figure out which services to deploy. Note that all services deployed this way will have access to the Module's classes.

Parameters:
module - the AxisModule to search for services
configCtx - ConfigurationContext in which to deploy
Throws:
AxisFault

normalize

public static String normalize(String uri)
Normalize a uri containing ../ and ./ paths.

Parameters:
uri - The uri path to normalize
Returns:
The normalized uri

getPath

public static String getPath(String parent,
                             String childPath)

findLibJars

public static List findLibJars(URL url)
Get names of all *.jar files inside the lib/ directory of a given jar URL

Parameters:
url - base URL of a JAR to search
Returns:
a List containing file names (Strings) of all files matching "[lL]ib/*.jar"

addExcludeMethods

public static void addExcludeMethods(ArrayList excludeList)
Add the Axis2 lifecycle / session methods to a pre-existing list of names that will be excluded when generating schemas.

Parameters:
excludeList - an ArrayList containing method names - we'll add ours to this.

createClassLoader

public static DeploymentClassLoader createClassLoader(File serviceFile)
                                               throws MalformedURLException
Throws:
MalformedURLException

createClassLoader

public static ClassLoader createClassLoader(ArrayList urls,
                                            ClassLoader serviceClassLoader,
                                            boolean extractJars,
                                            File tmpDir)

toFile

public static File toFile(URL url)
                   throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

createClassLoader

public static ClassLoader createClassLoader(URL[] urls,
                                            ClassLoader serviceClassLoader,
                                            boolean extractJars,
                                            File tmpDir)

processBeanPropertyExclude

public static void processBeanPropertyExclude(AxisService service)
This method is to process bean exclude parameter and the XML format of that would be +

Parameters:
service - , AxisService object

getShortFileName

public static String getShortFileName(String filename)

getAnnotatedServiceName

public static String getAnnotatedServiceName(Class serviceClass,
                                             WebService serviceAnnotation)
The util method to prepare the JSR 181 annotated service name from given annotation or for defaults JSR 181 specifies that the in javax.jws.WebService the parameter serviceName contains the wsdl:service name to mapp. If its not available then the default will be Simple name of the class + "Service"

Parameters:
serviceClass - the service Class
serviceAnnotation - a WebService annotation, or null
Returns:
String version of the ServiceName according to the JSR 181 spec

addEndpointsToService

public static void addEndpointsToService(AxisService axisService)
                                  throws AxisFault
Throws:
AxisFault

addEndpointsToService

public static void addEndpointsToService(AxisService axisService,
                                         AxisConfiguration axisConfiguration)
                                  throws AxisFault
Throws:
AxisFault

addSoap11Endpoint

public static void addSoap11Endpoint(AxisService axisService,
                                     URL url)
                              throws Exception
Throws:
Exception

addSoap12Endpoint

public static void addSoap12Endpoint(AxisService axisService,
                                     URL url)
                              throws Exception
Throws:
Exception

addHttpEndpoint

public static void addHttpEndpoint(AxisService axisService,
                                   URL url)

processPolicyAttachments

public static void processPolicyAttachments(Iterator attachmentElements,
                                            AxisService service)
                                     throws XMLStreamException,
                                            FactoryConfigurationError
Throws:
XMLStreamException
FactoryConfigurationError

isSoap11Binding

public static boolean isSoap11Binding(AxisBinding binding)

isSoap12Binding

public static boolean isSoap12Binding(AxisBinding binding)

isHttpBinding

public static boolean isHttpBinding(AxisBinding binding)

getSoap11Binding

public static AxisBinding getSoap11Binding(AxisService service)

getSoap12Binding

public static AxisBinding getSoap12Binding(AxisService service)

getHttpBinding

public static AxisBinding getHttpBinding(AxisService service)

getBindingOperation

public static AxisBindingOperation getBindingOperation(AxisBinding binding,
                                                       AxisOperation operation)

getBindingMessage

public static AxisBindingMessage getBindingMessage(AxisBindingOperation bindingOperation,
                                                   AxisMessage message)


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.