use of org.jboss.ejb.client.ClusterAffinity in project wildfly by wildfly.
the class AssociationImpl method getStatelessAffinity.
private Affinity getStatelessAffinity(Request request) {
ClusterTopologyRegistrar registrar = this.findClusterTopologyRegistrar(request.getLocalAddress());
Group group = (registrar != null) ? registrar.getGroup() : null;
return group != null && !group.isSingleton() ? new ClusterAffinity(group.getName()) : null;
}
use of org.jboss.ejb.client.ClusterAffinity in project eap-additional-testsuite by jboss-set.
the class RemoteEJBDirectory method lookup.
@Override
protected <T> T lookup(String beanName, Class<T> beanInterface, Type type) throws NamingException {
T bean = super.lookup(beanName, beanInterface, type);
Affinity affinity = new ClusterAffinity("ejb");
switch(type) {
case STATEFUL:
{
EJBClient.setStrongAffinity(bean, affinity);
break;
}
case STATELESS:
{
EJBClient.setWeakAffinity(bean, affinity);
break;
}
default:
{
// No need to set initial affinity
}
}
return bean;
}
use of org.jboss.ejb.client.ClusterAffinity in project eap-additional-testsuite by jboss-set.
the class RemoteEJBDirectory method lookup.
@Override
protected <T> T lookup(String beanName, Class<T> beanInterface, Type type) throws NamingException {
T bean = super.lookup(beanName, beanInterface, type);
Affinity affinity = new ClusterAffinity("ejb");
switch(type) {
case STATEFUL:
{
EJBClient.setStrongAffinity(bean, affinity);
break;
}
case STATELESS:
{
EJBClient.setWeakAffinity(bean, affinity);
break;
}
default:
{
// No need to set initial affinity
}
}
return bean;
}
Aggregations