org.benow.java.spec
Class SecureMethodSpecification

java.lang.Object
  extended by org.benow.java.spec.argument.ArgumentSpecification
      extended by org.benow.java.spec.MethodSpecification
          extended by org.benow.java.spec.SecureMethodSpecification

public class SecureMethodSpecification
extends org.benow.java.spec.MethodSpecification


Nested Class Summary
 
Nested classes/interfaces inherited from class org.benow.java.spec.MethodSpecification
org.benow.java.spec.MethodSpecification.DefaultMethod, org.benow.java.spec.MethodSpecification.MethodArgumentSpecifier
 
Field Summary
static org.apache.log4j.Logger log
           
 
Fields inherited from class org.benow.java.spec.MethodSpecification
method
 
Fields inherited from class org.benow.java.spec.argument.ArgumentSpecification
description
 
Constructor Summary
SecureMethodSpecification(java.lang.reflect.Method inMethod)
           
 
Method Summary
 void assertPermission()
           
 Permission getPermission()
           
protected  void introspectMethodSpec()
          Looks at a method and creates a method specification consisting of argument specifications.
 java.lang.Object invoke(java.lang.Object on, org.benow.java.spec.argument.ArgumentContext ctx)
           
static Permission resolvePermission(java.lang.String permFullName)
           
 
Methods inherited from class org.benow.java.spec.MethodSpecification
create, createSignature, createSignature, createSignature, getExceptionTypes, getReturnArgument, getSignature, getSimpleSignature, inClass
 
Methods inherited from class org.benow.java.spec.argument.ArgumentSpecification
addArg, addHelpArg, createArgByType, createArgumentContext, getArgumentByName, getArguments, getArgumentValues, getDescription, getLastArg, getLastArgName, getName, hasArgument, hasLastArg, requireOneOf, setDisplay, setName, specArg, specArg, specArg, specArg, specArg, specArg, specArg, specLastArg, specLastArg, toString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Logger log
Constructor Detail

SecureMethodSpecification

public SecureMethodSpecification(java.lang.reflect.Method inMethod)
                          throws org.benow.java.spec.SpecificationException
Throws:
org.benow.java.spec.SpecificationException
Method Detail

getPermission

public Permission getPermission()

resolvePermission

public static Permission resolvePermission(java.lang.String permFullName)
                                    throws org.benow.java.spec.SpecificationException
Throws:
org.benow.java.spec.SpecificationException

introspectMethodSpec

protected void introspectMethodSpec()
                             throws org.benow.java.spec.SpecificationException
Looks at a method and creates a method specification consisting of argument specifications. Once the specification has been introspected it can be used to construct a method call from arbitrary data sources... the primary of which is via named http post attributes. The method call is constructed, the method exectuted and the result returned.

Overrides:
introspectMethodSpec in class org.benow.java.spec.MethodSpecification
Throws:
SpecificationException

invoke

public java.lang.Object invoke(java.lang.Object on,
                               org.benow.java.spec.argument.ArgumentContext ctx)
                        throws java.lang.IllegalArgumentException,
                               java.lang.IllegalAccessException,
                               java.lang.Throwable
Overrides:
invoke in class org.benow.java.spec.MethodSpecification
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.Throwable

assertPermission

public void assertPermission()