Class WebSpherePackageScanClassResolver

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
All Implemented Interfaces:
AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.NonManagedService, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasCamelContext, org.apache.camel.spi.PackageScanClassResolver, org.apache.camel.StatefulService, org.apache.camel.StaticService, org.apache.camel.SuspendableService

public class WebSpherePackageScanClassResolver extends DefaultPackageScanClassResolver
WebSphere specific resolver to handle loading annotated resources in JAR files.
  • Constructor Details

    • WebSpherePackageScanClassResolver

      public WebSpherePackageScanClassResolver(String resourcePath)
      Constructor.
      Parameters:
      resourcePath - the fixed resource path to use for fetching camel jars in WebSphere.
  • Method Details

    • isWebSphereClassLoader

      public static boolean isWebSphereClassLoader(ClassLoader loader)
      Is the classloader from IBM and thus the WebSphere platform?
      Parameters:
      loader - the classloader
      Returns:
      true if IBM classloader, false otherwise.
    • getResources

      protected Enumeration<URL> getResources(ClassLoader loader, String packageName) throws IOException
      Overloaded to handle specific problem with getting resources on the IBM WebSphere platform.

      WebSphere can not load resources if the resource to load is a folder name, such as a packagename, you have to explicit name a resource that is a file.

      Overrides:
      getResources in class BasePackageScanResolver
      Parameters:
      loader - the classloader
      packageName - the packagename for the package to load
      Returns:
      URL's for the given package
      Throws:
      IOException - is thrown by the classloader