|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.sahits.util.FriendPattern
public class FriendPattern
This class helps to ensure, that a call of a
method only stems from a specific class
or even a specific method within that class.
This is a realization of the friend pattern
| Constructor Summary | |
|---|---|
FriendPattern(java.lang.Class c,
java.lang.String mName)
Constructor initializes the allowed class and method. |
|
FriendPattern(java.lang.Class c,
java.lang.String mName,
boolean includClassHirarchy,
java.lang.Class class2BChecked)
Constructor initializes the allowed class and method. |
|
| Method Summary | |
|---|---|
void |
checkAccess()
Check if the method call stems from an allowed Class/Method. |
protected java.lang.ClassLoader |
getClassLoader()
Retrieve the default class loader for this class |
protected void |
setClassLoader(java.lang.ClassLoader cl)
Set the ClassLoader that is needed in checkAccess(). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FriendPattern(java.lang.Class c,
java.lang.String mName)
c - Class from whence access is allowedmName - method name from which access is allowed.
public FriendPattern(java.lang.Class c,
java.lang.String mName,
boolean includClassHirarchy,
java.lang.Class class2BChecked)
c - Class from whence access is allowedmName - method name from which access is allowed.includClassHirarchy - flag indicating if the class hierarchy should be taken into accountclass2BChecked - Class to be checkted may be null if includClassHirarchy is false| Method Detail |
|---|
public void checkAccess()
java.lang.RuntimeException - Method is not allowed to be accessed or the method was called from somewhere not allowedprotected void setClassLoader(java.lang.ClassLoader cl)
checkAccess().
This implementation does nothing since the default class loader is
always used.
cl - Instance of a class loader or nullprotected java.lang.ClassLoader getClassLoader()
getClassLoader()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||