Uploaded image for project: 'Application Server 3  4  5 and 6'
  1. Application Server 3 4 5 and 6
  2. JBAS-4106

Allow use of classes from scoped loaders in ClusterPartition RPC calls

    XMLWordPrintable

Details

    • Feature Request
    • Resolution: Done
    • Major
    • JBossAS-5.0.0.Beta2
    • None
    • Clustering
    • None
    • Documentation (Ref Guide, User Guide, etc.), Compatibility/Configuration
    • Medium
    • 0
    • 0% 0%

    Description

      ClusterPartition RPC calls will currently fail if any classes in the RPC or in the return value are not visible to ClusterPartition's classloader. This is because message unmarshalling will fail to resolve the scoped class.

      To fix this:

      1) Add overloaded method registerRPCHandler(String key, Object handler, Classloader classloader) to ClusterPartition.

      2) Add field ConcurrentHashMap<String, WeakReference<Classloader>> to ClusterPartition.

      3) Refactor the way the service name is passed in the marshalled RPC. Now it is dot appended to the RPC's method name. Instead marshall it separately; e.g. the marshalled data structure could be new Object[]

      { serviceName, new MarshalledValue(methodCall) }

      or something like that.

      4) Unmarshalling deserializes the above, reads the serviceName, looks up the classloader in the map; if found sets the TCCL, and then calls MarshalledValue.get() to get the MethodCall.

      Alternative is not to create a separate map for the classloaders, but change the current map that stores the handlers to instead store a simple data type that wraps the handler and the classloader. Have to use a WeakReference for the classloader though.

      The existing usage where no classloader is registered still has to work; i.e. if no classloader is found don't touch the TCCL.

      Attachments

        Activity

          People

            jerrygauth Jerry Gauthier (Inactive)
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: