com.lutris.multiServer
Interface ActKeyValidation
- public interface ActKeyValidation
This interface is provided so that some sort of key checking or
validation on the right-to-run of a servlet is performed.
Note that this isn't the most secure implementation of this schema;
as the wily hacker who is trying to circumvent checking can
just compile up their own version of whatever calls instantiations
of this interface and put it before the original one in the classpath.
This class can also be used as an initializer for a check or a set of
checks that will be called in the performance of an application to
see what level of survice the runner of the application has subscribed
to.
For instance, if the following class if defined:
class Checkpoint implements com.lutris.multiServer.ActKeyValidation {
...
boolean hasMinimalServiceContract() ...
boolean hasExpensiveServiceContract() ...
}
Then other portions of the application can just call into that class's
hasMinimalServiceContract
and
hasExpensiveServiceContract
methods to find out if
extra-charge portions of the application are allowed to run.
- Author:
- Jason Abbott (jason@lutris.com)
- See Also:
org.enhydra.servlet.multiServer.MultiServer#readConfigFile
Method Summary |
void |
validate(Config config,
org.apache.log4j.Logger logger)
Classes of this instance will only be instanciated and then have
this one function called to validate the currently running servlet's
right-to-run. |
validate
public void validate(Config config,
org.apache.log4j.Logger logger)
throws ActKeyValidationException
- Classes of this instance will only be instanciated and then have
this one function called to validate the currently running servlet's
right-to-run. If the validation routine is to do anything short of
halting the servlet then it should not throw an exception.
- Parameters:
config
- The Config structure of the configuration file. This will
probably contain information you need in order to validate
this servlet (such as an activation key or serial number).
- Throws:
ActKeyValidationException
- This Exception can be thrown if the servlet is detected as
running an illegal copy. This will probably result in the
catcher of this exception in halting the servlet.