com.bigdata.jini.start.config
Class AbstractHostConstraint

java.lang.Object
  extended by com.bigdata.jini.start.config.AbstractHostConstraint
All Implemented Interfaces:
IServiceConstraint, Serializable
Direct Known Subclasses:
HostAllowConstraint, HostRejectConstraint

public abstract class AbstractHostConstraint
extends Object
implements IServiceConstraint

Core impl.

Version:
$Id$
Author:
Bryan Thompson
See Also:
Serialized Form
TODO:
do a variant based on InetAddress. This might allow the direct specification of a subnet.

Field Summary
protected static boolean DEBUG
           
protected  String[] hosts
           
protected static boolean INFO
           
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
AbstractHostConstraint(String host)
           
AbstractHostConstraint(String[] hosts)
           
 
Method Summary
abstract  boolean allow()
           
protected  boolean allow(boolean accept)
           
 boolean allow(JiniFederation ignored)
          Return true iff a service may be instantiated on this host.
static boolean isLocalHost(String hostname)
          Return true if hostname is a name for the local host.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log

INFO

protected static final boolean INFO

DEBUG

protected static final boolean DEBUG

hosts

protected final String[] hosts
Constructor Detail

AbstractHostConstraint

public AbstractHostConstraint(String host)
                       throws UnknownHostException
Throws:
UnknownHostException

AbstractHostConstraint

public AbstractHostConstraint(String[] hosts)
                       throws UnknownHostException
Throws:
UnknownHostException
Method Detail

toString

public String toString()
Overrides:
toString in class Object

allow

protected boolean allow(boolean accept)

isLocalHost

public static final boolean isLocalHost(String hostname)
                                 throws UnknownHostException
Return true if hostname is a name for the local host.

Parameters:
hostname - A host name.
Throws:
UnknownHostException

allow

public abstract boolean allow()

allow

public boolean allow(JiniFederation ignored)
Description copied from interface: IServiceConstraint
Return true iff a service may be instantiated on this host.

Note: Constraints which can be evaluated without the federation reference MUST NOT throw an exception if that reference is null. This allows us to evaluate constraints for boostrap services as well as for ManagedServiceConfigurations

Specified by:
allow in interface IServiceConstraint
Parameters:
ignored - The federation.


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.