public boolean is_allowed ( DeviceImpl dev , Any data_in ) { if ( state_method == null ) return true ; else { // // If the Method reference is not null, execute the method with the invoke // method // try { java . lang . Object [ ] meth_param = new java . lang . Object [ 1 ] ; meth_param [ 0 ] = data_in ; java . lang . Object obj = state_method . invoke ( dev , meth_param ) ; return ( Boolean ) obj ; } catch ( InvocationTargetException e ) { return false ; } catch ( IllegalArgumentException e ) { return false ; } catch ( IllegalAccessException e ) { return false ; } } }
Invoke the command allowed method given at object creation time .