jet.server.api.cluster
Interface ClusterService


public interface ClusterService

The ClusterService interface provides methods to access active cluster members information and load balancer.

Since 10.0, JReport cluster is a peer to peer architecture (rather than admin/backup), and discover members automatically.
So, admin/backup related and member registerLocalMember/removeLocalMember was deprecated in this version.

Since:
5.0

Method Summary
 Member getAdminMember()
          Deprecated. no replacement. As of 10.0. Further, the behavior of calling this was never specified.
 Member[] getAllMembers()
          Returns all active members of cluster.
 java.lang.String getClusterName()
          Returns the cluster name.
 LoadBalancer getDefaultLoadBalancer()
          Gets the default load balancer.
 Member getLocalMember()
          Returns the local member.
 Member getMember()
          Selects a member by a load balancer.
If the load balancer is null, this call returns localMember.
 boolean isAdminServerCrashed()
          Deprecated. no replacement. As of 10.0, this call returns false.
 boolean isTaskQueueFull(int priority)
          Deprecated. no replacement. As of 10.0, this call returns false.
 void registerLocalMember()
          Deprecated. no replacement. As of 10.0, this call NOP.
 void removeLocalMember()
          Deprecated. no replacement. As of 10.0, this call NOP.
 void setDefaultLoadBalancer(LoadBalancer lb)
          Sets customized load balancer to replace default load balancer.
 

Method Detail

getClusterName

java.lang.String getClusterName()
Returns the cluster name.

Returns:
the cluster name.

getAllMembers

Member[] getAllMembers()
                       throws ClusterException
Returns all active members of cluster.

Returns:
all active members.
Throws:
ClusterException - if calling this after shutdown.

getLocalMember

Member getLocalMember()
Returns the local member.

Returns:
the local member.

getAdminMember

Member getAdminMember()
                      throws ClusterException
Deprecated. no replacement. As of 10.0. Further, the behavior of calling this was never specified.

Returns the admin member of the cluster.

Returns:
the admin member.
Throws:
ClusterException - if calling this after shutdown.

getDefaultLoadBalancer

LoadBalancer getDefaultLoadBalancer()
Gets the default load balancer.

Returns:
the default load balancer.

setDefaultLoadBalancer

void setDefaultLoadBalancer(LoadBalancer lb)
Sets customized load balancer to replace default load balancer.

Parameters:
lb - the load balancer instance, if null, getMember will return localMember.
See Also:
getMember()

getMember

Member getMember()
Selects a member by a load balancer.
If the load balancer is null, this call returns localMember.

Returns:
the selected member.
See Also:
setDefaultLoadBalancer(LoadBalancer)

registerLocalMember

void registerLocalMember()
                         throws ClusterException
Deprecated. no replacement. As of 10.0, this call NOP.

Registers local member in cluster's member table.

Throws:
ClusterException - if calling this after shutdown.

removeLocalMember

void removeLocalMember()
                       throws ClusterException
Deprecated. no replacement. As of 10.0, this call NOP.

Removes local member from cluster's member table.

Throws:
ClusterException - if calling this after shutdown.

isAdminServerCrashed

boolean isAdminServerCrashed()
Deprecated. no replacement. As of 10.0, this call returns false.

Judges that if admin server is really crashed. Invoke this method when java.rmi.ConnectException or java.rmi.ConnectIOExcetpion was caught.

Returns:
true if admin server is really crashed, otherwise false.

isTaskQueueFull

boolean isTaskQueueFull(int priority)
Deprecated. no replacement. As of 10.0, this call returns false.

Returns whether cluster server task queue is full.

Parameters:
priority, - the priority of task.
Returns:
If cluster task queue is full return true, otherwise return false.