Uploaded image for project: 'EJB Client Library (AS7+)'
  1. EJB Client Library (AS7+)
  2. EJBCLIENT-234

Provide a means for the user to obtain a proxy with cluster affinity.

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • None

      At present, the affinity associated with a EJB SFSB or SLSB proxy is determined via one of two possible cases:

      • if a PROVIDER_URL (or remote.connection equivalent) was specified in the JNDI environment, the bean will have URIAffinity where the associated URI matches the URI of the PROVIDER_URL
      • if no PROVIDER_URL was specified, the bean will have Affinity.NONE

      In order to obtain a bean with affinity other than URIAffinity or NONE, we have to specifically set the strong affinity after creating the bean, as in for example:

      SomeBean bean = initialContext.lookup("ejb://app/module/distinct/SomeBean");
      ClusterAffinity clusterAffinity = new ClusterAffinity("ejb");
      EJBClient.setStrongAffinity(bean,clusterAffinity);
      

      Three options were considered for providing a mechanism to set the affinity of a bean:

      • Environment property e.g. env.put(EJBClient.CLUSTER_AFFINITY, "clusterName");
      • Query string e.g. context.lookup("ejb:foo/bar/baz?cluster=clusterName");
      • A special provider e.g. env.put(Context.PROVIDER_URL, "cluster:clusterName");

      The first two options are sticky, in the sense that the affinity choice is tied tothe context as a whole; the latter permits assigning differing strong affinities to beans from the same context.

              Unassigned Unassigned
              rachmato@redhat.com Richard Achmatowicz
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: