org.tanukisoftware.wrapper.security
Class WrapperEventPermission

java.lang.Object
  extended by java.security.Permission
      extended by org.tanukisoftware.wrapper.security.WrapperEventPermission
All Implemented Interfaces:
Serializable, Guard

public class WrapperEventPermission
extends Permission

WrapperEventPermissions are used to grant the right to register to start receiving events from the Wrapper.

Some of these permissions can result in performance degredations if used impropperly.

The following are examples of how to specify the permission within a policy file.

   grant codeBase "file:../lib/-" {
     // Grant various permissions to a specific service.
     permission org.tanukisoftware.wrapper.security.WrapperEventPermission "service";
     permission org.tanukisoftware.wrapper.security.WrapperEventPermission "service, core";
     permission org.tanukisoftware.wrapper.security.WrapperEventPermission "*";
   };
 

Possible eventTypes include the following:

Permission Event Type Name What the Permission Allows Risks of Allowing this Permission
service Register to obtain events whenever the Wrapper service receives any service events. Malicious code could receive this event and never return and thus cause performance and timeout problems with the Wrapper. Normal use of these events are quite safe however.
control Register to obtain events whenever the Wrapper receives any system control signals. Malicious code could trap and consome control events, thus preventing an application from being shut down cleanly.
core Register to obtain events on the core workings of the Wrapper. Malicious code or even well meaning code can greatly affect the performance of the Wrapper simply by handling these methods slowly. Some of these events are fired from within the core timing code of the Wrapper. They are useful for testing and performance checks, but in general they should not be used by most applications.

Author:
Leif Mortenson
See Also:
Serialized Form

Field Summary
static String EVENT_TYPE_CONTROL
           
static String EVENT_TYPE_CORE
           
static String EVENT_TYPE_SERVICE
           
 
Constructor Summary
WrapperEventPermission(String eventTypes)
          Creates a new WrapperEventPermission for the specified service.
 
Method Summary
 boolean equals(Object obj)
          Checks two Permission objects for equality.
 String getActions()
          Return the canonical string representation of the eventTypes.
 int hashCode()
          Returns the hash code value for this object.
 boolean implies(Permission p2)
          Checks if this WrapperEventPermission object "implies" the specified permission.
 PermissionCollection newPermissionCollection()
          Returns an custom WECollection implementation of a PermissionCollection.
 
Methods inherited from class java.security.Permission
checkGuard, getName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

EVENT_TYPE_SERVICE

public static String EVENT_TYPE_SERVICE

EVENT_TYPE_CONTROL

public static String EVENT_TYPE_CONTROL

EVENT_TYPE_CORE

public static String EVENT_TYPE_CORE
Constructor Detail

WrapperEventPermission

public WrapperEventPermission(String eventTypes)
Creates a new WrapperEventPermission for the specified service.

Parameters:
eventTypes - The event type or event types to be registered.
Method Detail

equals

public boolean equals(Object obj)
Checks two Permission objects for equality.

Do not use the equals method for making access control decisions; use the implies method.

Specified by:
equals in class Permission
Parameters:
obj - The object we are testing for equality with this object.
Returns:
True if both Permission objects are equivalent.

getActions

public String getActions()
Return the canonical string representation of the eventTypes. Always returns present eventTypes in the following order: start, stop, pause, continue, interrogate. userCode.

Specified by:
getActions in class Permission
Returns:
the canonical string representation of the eventTypes.

implies

public boolean implies(Permission p2)
Checks if this WrapperEventPermission object "implies" the specified permission.

More specifically, this method returns true if:

Specified by:
implies in class Permission
Parameters:
p2 - the permission to check against.
Returns:
true if the specified permission is implied by this object,

newPermissionCollection

public PermissionCollection newPermissionCollection()
Returns an custom WECollection implementation of a PermissionCollection.

Overrides:
newPermissionCollection in class Permission

hashCode

public int hashCode()
Returns the hash code value for this object.

Specified by:
hashCode in class Permission
Returns:
A hash code value for this object.


Copyright 1999, 2006 Tanuki Software Inc., All Rights Reserved.