Is it posible to get an Object every time i use a method.

description is here:


        
            
        
    


method is interceptor`s invoke(..):

class handleris implements IHandler {
    private Log _log;
    private Object _delegate;
    private User user;

    public User getPrisilogines() {
        return user;
    }

    public void setPrisilogines(User user) {
        this.user= user;
    }

    public Object invoke(Object proxy, Method m, Object[] 
args) throws Throwable {

        if (_log==null) {
            throw new 
IllegalStateException("_log is null. Call setLog()");
        }
        if (_delegate==null) {
            throw new 
IllegalStateException("_delegate is null. Call setDelegate()s");
        }

//>>>  i want to get value everyt time method is invoked
       System.out.println(user.getEmail());
        Object result;
        try {
            System.out.println("before 
method: " + m.getName());
            }
            result = m.invoke(_delegate, 
args);
        } catch (InvocationTargetException e) 
{
            throw e.getTargetException();
        } catch (Exception e) {
            throw new 
RuntimeException("unexpected invocation exception: " +
                    
e.getMessage());
        } finally {
            System.out.println("after 
method: " + m.getName());
        }
        return result;



    }

    public void setLog(Log _log) {
        this._log = _log;
    }

    public void setDelegate(Object _delegate) {
        this._delegate = _delegate;
    }
}



-------------------- m2f --------------------

Sent from www.TapestryForums.com

Read this topic online here: <<topic_link>>

http://www.tapestryforums.com/viewtopic.php?p=14221#14221

-------------------- m2f --------------------


Reply via email to