You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by tv...@apache.org on 2007/05/05 08:58:51 UTC

svn commit: r535465 [40/49] - in /jakarta/turbine/fulcrum/trunk: ./ bsf/ bsf/src/java/org/apache/fulcrum/bsf/ bsf/src/test/ bsf/xdocs/ cache/ cache/src/java/org/apache/fulcrum/cache/ cache/src/java/org/apache/fulcrum/cache/impl/ cache/src/test/ cache/s...

Modified: jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorContext.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorContext.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorContext.java (original)
+++ jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorContext.java Fri May  4 23:58:06 2007
@@ -1,100 +1,118 @@
-/*
- * Created on 14.09.2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.apache.fulcrum.yaafi.framework.interceptor;
-
-import java.lang.reflect.Method;
-import java.util.Map;
-
-import org.apache.fulcrum.yaafi.framework.tls.ThreadLocalStorage;
-
-/**
- * Contains context information for the interceptors being invoked. The
- * class contains a request context which allows to store data from within an
- * interceptor. It also provides access to a ThreadLocalStorage to associate
- * data with the current thread.
- *
- * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
- */
-public interface AvalonInterceptorContext
-{
-    /**
-     * @return Returns the context for the given request.
-     */
-    Map getRequestContext();
-
-    /**
-     * @return Returns the serviceDelegate.
-     */
-    Object getServiceDelegate();
-
-    /**
-     * @return Returns the serviceName.
-     */
-    String getServiceName();
-
-    /**
-     * @return Returns the serviceShorthand.
-     */
-    String getServiceShorthand();
-
-    /**
-     * @return Returns the args.
-     */
-    Object [] getArgs();
-
-    /**
-     * @return Returns the method.
-     */
-    Method getMethod();
-
-    /**
-     * @return Returns the ThreadLocalStorage
-     */
-    ThreadLocalStorage getThreadContext();
-
-    /**
-     * @return is a transaction id defined for the current thread
-     */
-    boolean hasTransactionId();
-
-    /**
-     * @return get the transaction id defined for the current thread
-     */
-    Object getTransactionId();
-
-    /**
-     * Set the transaction id for the current thread.
-     * @param transactionId the transaction id
-     */
-    void setTransactionId(Object transactionId);
-
-    /**
-     * Clears the transaction id for the current thread.
-     */
-    void clearTransactionId();
-
-    /**
-     * Increment the current service invocation depth
-     */
-    void incrementInvocationDepth();
-
-    /**
-     * Decrement the current service invocation depth
-     */
-    void decrementInvocationDepth();
-
-    /**
-     * Get the current service invocation depth
-     * @return the current service invocation depth
-     */
-    int getInvocationDepth();
-
-    /**
-     * @return Returns the invocationId.
-     */
-    Long getInvocationId();
-}
\ No newline at end of file
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+/*
+ * Created on 14.09.2005
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.apache.fulcrum.yaafi.framework.interceptor;
+
+import java.lang.reflect.Method;
+import java.util.Map;
+
+import org.apache.fulcrum.yaafi.framework.tls.ThreadLocalStorage;
+
+/**
+ * Contains context information for the interceptors being invoked. The
+ * class contains a request context which allows to store data from within an
+ * interceptor. It also provides access to a ThreadLocalStorage to associate
+ * data with the current thread.
+ *
+ * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
+ */
+public interface AvalonInterceptorContext
+{
+    /**
+     * @return Returns the context for the given request.
+     */
+    Map getRequestContext();
+
+    /**
+     * @return Returns the serviceDelegate.
+     */
+    Object getServiceDelegate();
+
+    /**
+     * @return Returns the serviceName.
+     */
+    String getServiceName();
+
+    /**
+     * @return Returns the serviceShorthand.
+     */
+    String getServiceShorthand();
+
+    /**
+     * @return Returns the args.
+     */
+    Object [] getArgs();
+
+    /**
+     * @return Returns the method.
+     */
+    Method getMethod();
+
+    /**
+     * @return Returns the ThreadLocalStorage
+     */
+    ThreadLocalStorage getThreadContext();
+
+    /**
+     * @return is a transaction id defined for the current thread
+     */
+    boolean hasTransactionId();
+
+    /**
+     * @return get the transaction id defined for the current thread
+     */
+    Object getTransactionId();
+
+    /**
+     * Set the transaction id for the current thread.
+     * @param transactionId the transaction id
+     */
+    void setTransactionId(Object transactionId);
+
+    /**
+     * Clears the transaction id for the current thread.
+     */
+    void clearTransactionId();
+
+    /**
+     * Increment the current service invocation depth
+     */
+    void incrementInvocationDepth();
+
+    /**
+     * Decrement the current service invocation depth
+     */
+    void decrementInvocationDepth();
+
+    /**
+     * Get the current service invocation depth
+     * @return the current service invocation depth
+     */
+    int getInvocationDepth();
+
+    /**
+     * @return Returns the invocationId.
+     */
+    Long getInvocationId();
+}

Modified: jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorContextImpl.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorContextImpl.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorContextImpl.java (original)
+++ jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorContextImpl.java Fri May  4 23:58:06 2007
@@ -1,267 +1,269 @@
-package org.apache.fulcrum.yaafi.framework.interceptor;
-
-/*
- * Copyright 2004 Apache Software Foundation
- * Licensed  under the  Apache License,  Version 2.0  (the "License");
- * you may not use  this file  except in  compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed  under the  License is distributed on an "AS IS" BASIS,
- * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.fulcrum.yaafi.framework.tls.ThreadLocalStorage;
-import org.apache.fulcrum.yaafi.framework.tls.ThreadLocalStorageImpl;
-import org.apache.fulcrum.yaafi.framework.util.ToStringBuilder;
-import org.apache.fulcrum.yaafi.framework.util.Validate;
-
-/**
- * Contains context information for the interceptors being invoked. The
- * class contains a request context which allows to store data from within an
- * interceptor. It also provides access to a ThreadLocalStorage to associate
- * data with the current thread.
- *
- * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
- */
-
-public class AvalonInterceptorContextImpl implements AvalonInterceptorContext
-{
-    /** key for looking up the transaction id */
-    private static final String TRANSACTIONID_KEY =
-        "$org.apache.fulcrum.yaafi.framework.interceptor.AvalonInterceptorContext#transactionId";
-
-    /** key for looking up the service invocation depth */
-    private static final String INVOCATIONDEPTH_KEY =
-        "$org.apache.fulcrum.yaafi.framework.interceptor.AvalonInterceptorContext#invocationDepth";
-
-    /** the name of the service being intercepted */
-    private String serviceName;
-
-    /** the shorthand of the service being intercepted */
-    private String serviceShorthand;
-
-    /** the real service implementation */
-    private Object serviceDelegate;
-
-    /** the method being invoked */
-    private Method method;
-
-    /** the arguments for the method invocation */
-    private Object[] args;
-
-    /** context information associated with the current invocation */
-    private HashMap requestContext;
-    
-    /** context information associated with the current thread */
-    private static ThreadLocalStorageImpl tls = new ThreadLocalStorageImpl();
-    
-    /** works as invocation counter */
-    private static volatile long invocationCounter = 0L;
-    
-    /** the associated transaction id */
-    private Long invocationId;
-
-    /**
-     * Constructor.
-     *
-     * @param serviceName the name of the service being intercepted
-     * @param serviceShorthand the shorthand of the service being intercepted
-     * @param serviceDelegate the real service implementation
-     * @param method the method being invoked
-     * @param args the list of arguments for the method invocation
-     */
-    public AvalonInterceptorContextImpl(
-        String serviceName, String serviceShorthand, Object serviceDelegate, Method method, Object[] args )
-    {
-        Validate.notEmpty(serviceName,"serviceName");
-        Validate.notEmpty(serviceShorthand,"serviceShorthand");
-        Validate.notNull(serviceDelegate,"serviceDelegate");
-        Validate.notNull(method,"method");
-
-        this.invocationId = new Long(++AvalonInterceptorContextImpl.invocationCounter);    
-        this.serviceName = serviceName;
-        this.serviceShorthand = serviceShorthand;
-        this.serviceDelegate = serviceDelegate;
-        this.method = method;
-        this.args = args;
-        this.requestContext = new HashMap();
-    }
-
-    /**
-     * @return Returns the context for the given request.
-     */
-    public final Map getRequestContext()
-    {
-        return requestContext;
-    }
-
-    /**
-     * @return Returns the serviceDelegate.
-     */
-    public final Object getServiceDelegate()
-    {
-        return serviceDelegate;
-    }
-
-    /**
-     * @return Returns the serviceName.
-     */
-    public final String getServiceName()
-    {
-        return serviceName;
-    }
-
-    /**
-     * @return Returns the serviceShorthand.
-     */
-    public String getServiceShorthand()
-    {
-        return serviceShorthand;
-    }
-
-    /**
-     * @return Returns the args.
-     */
-    public final Object [] getArgs()
-    {
-        return args;
-    }
-
-    /**
-     * @return Returns the method.
-     */
-    public final Method getMethod()
-    {
-        return method;
-    }
-
-    /**
-     * @return Returns the ThreadLocalStorage
-     */
-    public final ThreadLocalStorage getThreadContext()
-    {
-        return AvalonInterceptorContextImpl.tls;
-    }
-
-    /**
-     * @return is a transaction id defined for the current thread
-     */
-    public boolean hasTransactionId()
-    {
-        return ( this.getTransactionId() != null ? true : false );
-    }
-    
-    /**
-     * @return get the transaction id defined for the current thread
-     */
-    public Object getTransactionId()
-    {
-        return this.getThreadContext().get(TRANSACTIONID_KEY);
-    }
-
-    /**
-     * Set the transaction id for the current thread.
-     * @param transactionId the transaction id
-     */
-    public void setTransactionId( Object transactionId )
-    {
-        this.getThreadContext().put(TRANSACTIONID_KEY,transactionId);
-    }
-
-    /**
-     * Clears the transaction id for the current thread.
-     */
-    public void clearTransactionId()
-    {
-        this.setTransactionId(null);
-    }
-
-    /**
-     * Increment the current service invocation depth
-     */
-    public void incrementInvocationDepth()
-    {
-        Integer invocationDepth = (Integer) this.getThreadContext().get(INVOCATIONDEPTH_KEY);
-        
-        if( invocationDepth != null )
-        {
-            int currInvocationDepth = invocationDepth.intValue();
-            this.getThreadContext().put(INVOCATIONDEPTH_KEY, new Integer(++currInvocationDepth));
-        }
-        else
-        {
-            this.getThreadContext().put(INVOCATIONDEPTH_KEY, new Integer(0));
-        }
-    }
-    
-    /**
-     * Decrement the current service invocation depth
-     */
-    public void decrementInvocationDepth()
-    {
-        Integer invocationDepth = (Integer) this.getThreadContext().get(INVOCATIONDEPTH_KEY);
-        
-        if( invocationDepth != null )
-        {
-            int currInvocationDepth = invocationDepth.intValue();
-            this.getThreadContext().put(INVOCATIONDEPTH_KEY, new Integer(--currInvocationDepth));
-        }
-    }
-    
-    /**
-     * Get the current service invocation depth
-     * @return the current service invocation depth
-     */
-    public int getInvocationDepth()
-    {
-        Integer invocationDepth = (Integer) this.getThreadContext().get(INVOCATIONDEPTH_KEY);
-        
-        if( invocationDepth != null )
-        {
-            return invocationDepth.intValue();
-        }
-        else
-        {
-            return 0;
-        }
-    }
-    
-    /**
-     * @return Returns the invocationId.
-     */
-    public final Long getInvocationId()
-    {
-        return invocationId;
-    }
-    
-    /**
-     * @see java.lang.Object#toString()
-     */
-    public String toString()
-    {
-        ToStringBuilder toStringBuilder = new ToStringBuilder(this);
-        
-        toStringBuilder.append("serviceShorthand",this.serviceShorthand);
-        toStringBuilder.append("serviceName",this.serviceName);
-        toStringBuilder.append("serviceDelegate",this.serviceDelegate);
-        toStringBuilder.append("method",this.method.getName());
-        toStringBuilder.append("args",this.args.length);
-        toStringBuilder.append("transactionId",this.getTransactionId());
-        toStringBuilder.append("invocationId",this.invocationId);
-        toStringBuilder.append("invocationDepth",this.getInvocationDepth());
-        toStringBuilder.append("requestContext",this.requestContext);
-        
-        return toStringBuilder.toString();
-    }
-}
\ No newline at end of file
+package org.apache.fulcrum.yaafi.framework.interceptor;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.fulcrum.yaafi.framework.tls.ThreadLocalStorage;
+import org.apache.fulcrum.yaafi.framework.tls.ThreadLocalStorageImpl;
+import org.apache.fulcrum.yaafi.framework.util.ToStringBuilder;
+import org.apache.fulcrum.yaafi.framework.util.Validate;
+
+/**
+ * Contains context information for the interceptors being invoked. The
+ * class contains a request context which allows to store data from within an
+ * interceptor. It also provides access to a ThreadLocalStorage to associate
+ * data with the current thread.
+ *
+ * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
+ */
+
+public class AvalonInterceptorContextImpl implements AvalonInterceptorContext
+{
+    /** key for looking up the transaction id */
+    private static final String TRANSACTIONID_KEY =
+        "$org.apache.fulcrum.yaafi.framework.interceptor.AvalonInterceptorContext#transactionId";
+
+    /** key for looking up the service invocation depth */
+    private static final String INVOCATIONDEPTH_KEY =
+        "$org.apache.fulcrum.yaafi.framework.interceptor.AvalonInterceptorContext#invocationDepth";
+
+    /** the name of the service being intercepted */
+    private String serviceName;
+
+    /** the shorthand of the service being intercepted */
+    private String serviceShorthand;
+
+    /** the real service implementation */
+    private Object serviceDelegate;
+
+    /** the method being invoked */
+    private Method method;
+
+    /** the arguments for the method invocation */
+    private Object[] args;
+
+    /** context information associated with the current invocation */
+    private HashMap requestContext;
+
+    /** context information associated with the current thread */
+    private static ThreadLocalStorageImpl tls = new ThreadLocalStorageImpl();
+
+    /** works as invocation counter */
+    private static volatile long invocationCounter = 0L;
+
+    /** the associated transaction id */
+    private Long invocationId;
+
+    /**
+     * Constructor.
+     *
+     * @param serviceName the name of the service being intercepted
+     * @param serviceShorthand the shorthand of the service being intercepted
+     * @param serviceDelegate the real service implementation
+     * @param method the method being invoked
+     * @param args the list of arguments for the method invocation
+     */
+    public AvalonInterceptorContextImpl(
+        String serviceName, String serviceShorthand, Object serviceDelegate, Method method, Object[] args )
+    {
+        Validate.notEmpty(serviceName,"serviceName");
+        Validate.notEmpty(serviceShorthand,"serviceShorthand");
+        Validate.notNull(serviceDelegate,"serviceDelegate");
+        Validate.notNull(method,"method");
+
+        this.invocationId = new Long(++AvalonInterceptorContextImpl.invocationCounter);
+        this.serviceName = serviceName;
+        this.serviceShorthand = serviceShorthand;
+        this.serviceDelegate = serviceDelegate;
+        this.method = method;
+        this.args = args;
+        this.requestContext = new HashMap();
+    }
+
+    /**
+     * @return Returns the context for the given request.
+     */
+    public final Map getRequestContext()
+    {
+        return requestContext;
+    }
+
+    /**
+     * @return Returns the serviceDelegate.
+     */
+    public final Object getServiceDelegate()
+    {
+        return serviceDelegate;
+    }
+
+    /**
+     * @return Returns the serviceName.
+     */
+    public final String getServiceName()
+    {
+        return serviceName;
+    }
+
+    /**
+     * @return Returns the serviceShorthand.
+     */
+    public String getServiceShorthand()
+    {
+        return serviceShorthand;
+    }
+
+    /**
+     * @return Returns the args.
+     */
+    public final Object [] getArgs()
+    {
+        return args;
+    }
+
+    /**
+     * @return Returns the method.
+     */
+    public final Method getMethod()
+    {
+        return method;
+    }
+
+    /**
+     * @return Returns the ThreadLocalStorage
+     */
+    public final ThreadLocalStorage getThreadContext()
+    {
+        return AvalonInterceptorContextImpl.tls;
+    }
+
+    /**
+     * @return is a transaction id defined for the current thread
+     */
+    public boolean hasTransactionId()
+    {
+        return ( this.getTransactionId() != null ? true : false );
+    }
+
+    /**
+     * @return get the transaction id defined for the current thread
+     */
+    public Object getTransactionId()
+    {
+        return this.getThreadContext().get(TRANSACTIONID_KEY);
+    }
+
+    /**
+     * Set the transaction id for the current thread.
+     * @param transactionId the transaction id
+     */
+    public void setTransactionId( Object transactionId )
+    {
+        this.getThreadContext().put(TRANSACTIONID_KEY,transactionId);
+    }
+
+    /**
+     * Clears the transaction id for the current thread.
+     */
+    public void clearTransactionId()
+    {
+        this.setTransactionId(null);
+    }
+
+    /**
+     * Increment the current service invocation depth
+     */
+    public void incrementInvocationDepth()
+    {
+        Integer invocationDepth = (Integer) this.getThreadContext().get(INVOCATIONDEPTH_KEY);
+
+        if( invocationDepth != null )
+        {
+            int currInvocationDepth = invocationDepth.intValue();
+            this.getThreadContext().put(INVOCATIONDEPTH_KEY, new Integer(++currInvocationDepth));
+        }
+        else
+        {
+            this.getThreadContext().put(INVOCATIONDEPTH_KEY, new Integer(0));
+        }
+    }
+
+    /**
+     * Decrement the current service invocation depth
+     */
+    public void decrementInvocationDepth()
+    {
+        Integer invocationDepth = (Integer) this.getThreadContext().get(INVOCATIONDEPTH_KEY);
+
+        if( invocationDepth != null )
+        {
+            int currInvocationDepth = invocationDepth.intValue();
+            this.getThreadContext().put(INVOCATIONDEPTH_KEY, new Integer(--currInvocationDepth));
+        }
+    }
+
+    /**
+     * Get the current service invocation depth
+     * @return the current service invocation depth
+     */
+    public int getInvocationDepth()
+    {
+        Integer invocationDepth = (Integer) this.getThreadContext().get(INVOCATIONDEPTH_KEY);
+
+        if( invocationDepth != null )
+        {
+            return invocationDepth.intValue();
+        }
+        else
+        {
+            return 0;
+        }
+    }
+
+    /**
+     * @return Returns the invocationId.
+     */
+    public final Long getInvocationId()
+    {
+        return invocationId;
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        ToStringBuilder toStringBuilder = new ToStringBuilder(this);
+
+        toStringBuilder.append("serviceShorthand",this.serviceShorthand);
+        toStringBuilder.append("serviceName",this.serviceName);
+        toStringBuilder.append("serviceDelegate",this.serviceDelegate);
+        toStringBuilder.append("method",this.method.getName());
+        toStringBuilder.append("args",this.args.length);
+        toStringBuilder.append("transactionId",this.getTransactionId());
+        toStringBuilder.append("invocationId",this.invocationId);
+        toStringBuilder.append("invocationDepth",this.getInvocationDepth());
+        toStringBuilder.append("requestContext",this.requestContext);
+
+        return toStringBuilder.toString();
+    }
+}

Modified: jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorFactory.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorFactory.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorFactory.java (original)
+++ jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorFactory.java Fri May  4 23:58:06 2007
@@ -1,130 +1,132 @@
-package org.apache.fulcrum.yaafi.framework.interceptor;
-
-/*
- * Copyright 2005 Apache Software Foundation
- * Licensed  under the  Apache License,  Version 2.0  (the "License");
- * you may not use  this file  except in  compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed  under the  License is distributed on an "AS IS" BASIS,
- * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Proxy;
-import java.util.List;
-
-import org.apache.avalon.framework.service.ServiceException;
-import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.fulcrum.yaafi.framework.constant.AvalonYaafiConstants;
-import org.apache.fulcrum.yaafi.framework.reflection.Clazz;
-import org.apache.fulcrum.yaafi.framework.util.ReadWriteLock;
-import org.apache.fulcrum.yaafi.framework.util.Validate;
-
-
-/**
- * A factory for creating dynamic proxies for Avalon services.
- *
- * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
- */
-
-public class AvalonInterceptorFactory
-{
-    /**
-     * Creates a dynamic proxy wrapping a service instance.
-     *
-     * @param serviceName the name of the service
-     * @param serviceShorthand the shorthand of the service being intercepted
-     * @param serviceManager the corresponding service manager
-     * @param serviceInterceptorList the list of interceptors to be installed
-     * @param serviceDelegate the service implementation
-     * @param readWriteLock the YAAFI kernel lock
-     * @return a dynamic proxy
-     * @throws ServiceException an interceptor was not found
-     */
-    public static Object create(
-        String serviceName,
-        String serviceShorthand,
-        ServiceManager serviceManager,
-        String[] serviceInterceptorList,
-        Object serviceDelegate,
-        ReadWriteLock readWriteLock )
-        throws ServiceException
-    {
-        Validate.notEmpty(serviceName,"serviceName");
-        Validate.notEmpty(serviceShorthand,"serviceShorthand");
-        Validate.notNull(serviceManager,"serviceManager");
-        Validate.notNull(serviceInterceptorList,"serviceInterceptorList");
-        Validate.notNull(serviceDelegate,"serviceDelegate");
-        Validate.notNull(readWriteLock,"readWriteLock");
-
-        Object result = null;
-
-        Class clazz = serviceDelegate.getClass();
-        ClassLoader classLoader = clazz.getClassLoader();
-        List interfaceList = Clazz.getAllInterfaces(clazz);
-
-        // get the service interfaces to avoid lookups
-
-        AvalonInterceptorService[] avalonInterceptorServices = resolve(
-            serviceManager,
-            serviceInterceptorList
-            );
-
-        InvocationHandler invocationHandler = new AvalonInterceptorInvocationHandler(
-            serviceName,
-            serviceShorthand,
-            serviceDelegate,
-            avalonInterceptorServices,
-            readWriteLock
-            );
-
-        result = Proxy.newProxyInstance(
-            classLoader,
-            (Class[]) interfaceList.toArray(new Class[interfaceList.size()]),
-            invocationHandler
-            );
-
-        return result;
-    }
-
-    /**
-     * Resolve all interceptor service names to service interfaces.
-     *
-     * @param serviceManager to lookup the services
-     * @param interceptorList the list of service names
-     * @return a list of interceptor services
-     * @throws ServiceException an interceptor service was not found
-     */
-    private static AvalonInterceptorService[] resolve( ServiceManager serviceManager, String[] interceptorList )
-        throws ServiceException
-    {
-        String interceptorServiceName = null;
-        AvalonInterceptorService[] result = new AvalonInterceptorService[interceptorList.length];
-
-        for( int i=0; i<interceptorList.length; i++ )
-        {
-            interceptorServiceName = interceptorList[i];
-            Object currService = serviceManager.lookup(interceptorServiceName);
-
-            if (currService instanceof AvalonInterceptorService)
-            {
-                result[i] = (AvalonInterceptorService) currService;
-            }
-            else
-            {
-                String msg = "The following service is not an AvalonInterceptorService : " + interceptorServiceName;
-                throw new ServiceException(AvalonYaafiConstants.AVALON_CONTAINER_YAAFI,msg);
-            }
-        }
-
-        return result;
-    }
-}
\ No newline at end of file
+package org.apache.fulcrum.yaafi.framework.interceptor;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Proxy;
+import java.util.List;
+
+import org.apache.avalon.framework.service.ServiceException;
+import org.apache.avalon.framework.service.ServiceManager;
+import org.apache.fulcrum.yaafi.framework.constant.AvalonYaafiConstants;
+import org.apache.fulcrum.yaafi.framework.reflection.Clazz;
+import org.apache.fulcrum.yaafi.framework.util.ReadWriteLock;
+import org.apache.fulcrum.yaafi.framework.util.Validate;
+
+
+/**
+ * A factory for creating dynamic proxies for Avalon services.
+ *
+ * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
+ */
+
+public class AvalonInterceptorFactory
+{
+    /**
+     * Creates a dynamic proxy wrapping a service instance.
+     *
+     * @param serviceName the name of the service
+     * @param serviceShorthand the shorthand of the service being intercepted
+     * @param serviceManager the corresponding service manager
+     * @param serviceInterceptorList the list of interceptors to be installed
+     * @param serviceDelegate the service implementation
+     * @param readWriteLock the YAAFI kernel lock
+     * @return a dynamic proxy
+     * @throws ServiceException an interceptor was not found
+     */
+    public static Object create(
+        String serviceName,
+        String serviceShorthand,
+        ServiceManager serviceManager,
+        String[] serviceInterceptorList,
+        Object serviceDelegate,
+        ReadWriteLock readWriteLock )
+        throws ServiceException
+    {
+        Validate.notEmpty(serviceName,"serviceName");
+        Validate.notEmpty(serviceShorthand,"serviceShorthand");
+        Validate.notNull(serviceManager,"serviceManager");
+        Validate.notNull(serviceInterceptorList,"serviceInterceptorList");
+        Validate.notNull(serviceDelegate,"serviceDelegate");
+        Validate.notNull(readWriteLock,"readWriteLock");
+
+        Object result = null;
+
+        Class clazz = serviceDelegate.getClass();
+        ClassLoader classLoader = clazz.getClassLoader();
+        List interfaceList = Clazz.getAllInterfaces(clazz);
+
+        // get the service interfaces to avoid lookups
+
+        AvalonInterceptorService[] avalonInterceptorServices = resolve(
+            serviceManager,
+            serviceInterceptorList
+            );
+
+        InvocationHandler invocationHandler = new AvalonInterceptorInvocationHandler(
+            serviceName,
+            serviceShorthand,
+            serviceDelegate,
+            avalonInterceptorServices,
+            readWriteLock
+            );
+
+        result = Proxy.newProxyInstance(
+            classLoader,
+            (Class[]) interfaceList.toArray(new Class[interfaceList.size()]),
+            invocationHandler
+            );
+
+        return result;
+    }
+
+    /**
+     * Resolve all interceptor service names to service interfaces.
+     *
+     * @param serviceManager to lookup the services
+     * @param interceptorList the list of service names
+     * @return a list of interceptor services
+     * @throws ServiceException an interceptor service was not found
+     */
+    private static AvalonInterceptorService[] resolve( ServiceManager serviceManager, String[] interceptorList )
+        throws ServiceException
+    {
+        String interceptorServiceName = null;
+        AvalonInterceptorService[] result = new AvalonInterceptorService[interceptorList.length];
+
+        for( int i=0; i<interceptorList.length; i++ )
+        {
+            interceptorServiceName = interceptorList[i];
+            Object currService = serviceManager.lookup(interceptorServiceName);
+
+            if (currService instanceof AvalonInterceptorService)
+            {
+                result[i] = (AvalonInterceptorService) currService;
+            }
+            else
+            {
+                String msg = "The following service is not an AvalonInterceptorService : " + interceptorServiceName;
+                throw new ServiceException(AvalonYaafiConstants.AVALON_CONTAINER_YAAFI,msg);
+            }
+        }
+
+        return result;
+    }
+}

Modified: jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorInvocationHandler.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorInvocationHandler.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorInvocationHandler.java (original)
+++ jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorInvocationHandler.java Fri May  4 23:58:06 2007
@@ -1,269 +1,271 @@
-package org.apache.fulcrum.yaafi.framework.interceptor;
-
-/*
- * Copyright 2004 Apache Software Foundation
- * Licensed  under the  Apache License,  Version 2.0  (the "License");
- * you may not use  this file  except in  compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed  under the  License is distributed on an "AS IS" BASIS,
- * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.apache.fulcrum.yaafi.framework.util.ReadWriteLock;
-import org.apache.fulcrum.yaafi.framework.util.Validate;
-
-/**
- * The InvocationHandler invoked when a service call is routed through
- * the dynamic proxy.
- *
- * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl </a>
- */
-
-public class AvalonInterceptorInvocationHandler implements InvocationHandler
-{
-    /** the name of the service */
-    private String serviceName;
-
-    /** the shorthand of the service */
-    private String serviceShorthand;
-
-    /** the real service implementation */
-    private Object serviceDelegate;
-
-    /** the list of interceptors to be invoked */
-    private AvalonInterceptorService [] serviceInterceptorList;
-    
-    /** read/write lock to snychronize access to services */
-    private ReadWriteLock readWriteLock;
-    
-    /** counts the current transactions */
-    private static volatile long transactionCounter = 0L;
-    
-    /** the current transaction id */
-    private Long transactionId;
-
-    /**
-     * Constructor.
-     *
-     * @param serviceName the name of the service
-     * @param serviceShorthand the shorthand of the service being intercepted
-     * @param serviceDelegate the real service implementation
-     * @param serviceInterceptorList the list of interceptors to be invoked
-     * @param readWriteLock the YAAFI kernel lock
-     */
-    public AvalonInterceptorInvocationHandler(
-        String serviceName,
-        String serviceShorthand,
-        Object serviceDelegate,
-        AvalonInterceptorService [] serviceInterceptorList,
-        ReadWriteLock readWriteLock )
-    {
-        Validate.notEmpty(serviceName,"serviceName");
-        Validate.notEmpty(serviceShorthand,"serviceShorthand");
-        Validate.notNull(serviceDelegate,"serviceDelegate");
-        Validate.notNull(serviceInterceptorList,"serviceInterceptorList");
-        Validate.notNull(readWriteLock,"readWriteLock");
-
-        this.serviceName = serviceName;
-        this.serviceShorthand = serviceShorthand;
-        this.serviceDelegate = serviceDelegate;
-        this.serviceInterceptorList = serviceInterceptorList;
-        this.readWriteLock = readWriteLock;
-    }
-
-    /**
-     * @return Returns the delegate.
-     */
-    public Object getServiceDelegate()
-    {
-        return this.serviceDelegate;
-    }
-
-    /**
-     * @return Returns the serviceInterceptorList.
-     */
-    public AvalonInterceptorService [] getServiceInterceptorList()
-    {
-        return serviceInterceptorList;
-    }
-
-    /**
-     * @return Returns the serviceName.
-     */
-    public String getServiceName()
-    {
-        return serviceName;
-    }
-
-    /**
-     * @return Returns the serviceShorthand.
-     */
-    public String getServiceShorthand()
-    {
-        return serviceShorthand;
-    }
-
-    /**
-     * @return Returns the transaction id
-     */
-    public Long getTransactionId()
-    {
-        return transactionId;
-    }
-
-    /**
-     * @see java.lang.Object#toString()
-     */
-    public String toString()
-    {
-        return super.toString();
-    }
-
-    /**
-     * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
-     */
-    public Object invoke(Object proxy, Method method, Object [] args)
-        throws Throwable
-    {
-        Object result = null;
-        Object lock = null;
-        
-        // create the interceptor context for current method call
-        
-        AvalonInterceptorContext context = new AvalonInterceptorContextImpl(
-            this.getServiceName(),
-            this.getServiceShorthand(),
-            this.getServiceDelegate(),
-            method,
-            args
-            );
-
-        // if no transaction id is currently define we create a new one
-        
-        boolean hasCreatedTransaction = this.createTransactionId(context);
-        
-        try
-        {
-            context.incrementInvocationDepth();
-            lock = this.getReadWriteLock().getReadLock(this.serviceName);
-            this.onEntry(context);
-            result = method.invoke( this.getServiceDelegate(), args );
-            this.onExit(context,result);
-            return result;
-        }
-        catch (InvocationTargetException e)
-        {
-            this.onError(context,e.getTargetException());
-            throw e.getTargetException();
-        }
-        catch (Throwable t)
-        {
-            throw t;
-        }
-        finally
-        {
-            // return the read lock 
-            
-            this.getReadWriteLock().releaseLock(lock,this.serviceName);
-            
-            // decrement the service invocation depth
-            
-            context.decrementInvocationDepth();
-            
-            // reset the transaction id if we have created it before
-            
-            if( hasCreatedTransaction )
-            {
-                context.clearTransactionId();
-            }   
-        }
-    }
-
-    /**
-     * Invoke the onEntry method on all service interceptors.
-     *
-     * @param context the current interceptor context
-     */
-    private void onEntry( AvalonInterceptorContext context )
-    {
-        for( int i=0; i<this.getServiceInterceptorList().length; i++ )
-        {
-            this.getServiceInterceptorList()[i].onEntry(context);
-        }
-    }
-
-    /**
-     * Invoke the onExit method on all service interceptors.
-     *
-     * @param context the current interceptor context
-     * @param result the result
-     */
-    private void onExit( AvalonInterceptorContext context, Object result )
-    {
-        for( int i=this.getServiceInterceptorList().length-1; i>=0; i-- )
-        {
-            this.getServiceInterceptorList()[i].onExit(context,result);
-        }
-    }
-
-    /**
-     * Invoke the onError method on all service interceptors.
-     *
-     * @param context the current interceptor context
-     * @param t the resulting exception
-     */
-    private void onError( AvalonInterceptorContext context, Throwable t )
-    {
-        for( int i=this.getServiceInterceptorList().length-1; i>=0; i-- )
-        {
-            this.getServiceInterceptorList()[i].onError(context,t);
-        }
-    }
-    
-    /**
-     * @return Returns the readWriteLock.
-     */
-    private final ReadWriteLock getReadWriteLock()
-    {
-        return readWriteLock;
-    }
-    
-    /**
-     * Creates a transaction id using the thread local storage
-     * @param context current interceptor context
-     * @return was a new transaction started
-     */
-    private boolean createTransactionId(AvalonInterceptorContext context)
-    {
-        Long currentTransactionId = null;
-        
-        if( context.hasTransactionId() == false )
-        {
-            // create a new transaction id
-            
-            currentTransactionId = new Long(
-                ++AvalonInterceptorInvocationHandler.transactionCounter
-                );
-            
-            // store it in the TLS
-            
-            context.setTransactionId(currentTransactionId);
-            
-            return true;
-        }
-        
-        return false;
-    }
-}
\ No newline at end of file
+package org.apache.fulcrum.yaafi.framework.interceptor;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.apache.fulcrum.yaafi.framework.util.ReadWriteLock;
+import org.apache.fulcrum.yaafi.framework.util.Validate;
+
+/**
+ * The InvocationHandler invoked when a service call is routed through
+ * the dynamic proxy.
+ *
+ * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl </a>
+ */
+
+public class AvalonInterceptorInvocationHandler implements InvocationHandler
+{
+    /** the name of the service */
+    private String serviceName;
+
+    /** the shorthand of the service */
+    private String serviceShorthand;
+
+    /** the real service implementation */
+    private Object serviceDelegate;
+
+    /** the list of interceptors to be invoked */
+    private AvalonInterceptorService [] serviceInterceptorList;
+
+    /** read/write lock to snychronize access to services */
+    private ReadWriteLock readWriteLock;
+
+    /** counts the current transactions */
+    private static volatile long transactionCounter = 0L;
+
+    /** the current transaction id */
+    private Long transactionId;
+
+    /**
+     * Constructor.
+     *
+     * @param serviceName the name of the service
+     * @param serviceShorthand the shorthand of the service being intercepted
+     * @param serviceDelegate the real service implementation
+     * @param serviceInterceptorList the list of interceptors to be invoked
+     * @param readWriteLock the YAAFI kernel lock
+     */
+    public AvalonInterceptorInvocationHandler(
+        String serviceName,
+        String serviceShorthand,
+        Object serviceDelegate,
+        AvalonInterceptorService [] serviceInterceptorList,
+        ReadWriteLock readWriteLock )
+    {
+        Validate.notEmpty(serviceName,"serviceName");
+        Validate.notEmpty(serviceShorthand,"serviceShorthand");
+        Validate.notNull(serviceDelegate,"serviceDelegate");
+        Validate.notNull(serviceInterceptorList,"serviceInterceptorList");
+        Validate.notNull(readWriteLock,"readWriteLock");
+
+        this.serviceName = serviceName;
+        this.serviceShorthand = serviceShorthand;
+        this.serviceDelegate = serviceDelegate;
+        this.serviceInterceptorList = serviceInterceptorList;
+        this.readWriteLock = readWriteLock;
+    }
+
+    /**
+     * @return Returns the delegate.
+     */
+    public Object getServiceDelegate()
+    {
+        return this.serviceDelegate;
+    }
+
+    /**
+     * @return Returns the serviceInterceptorList.
+     */
+    public AvalonInterceptorService [] getServiceInterceptorList()
+    {
+        return serviceInterceptorList;
+    }
+
+    /**
+     * @return Returns the serviceName.
+     */
+    public String getServiceName()
+    {
+        return serviceName;
+    }
+
+    /**
+     * @return Returns the serviceShorthand.
+     */
+    public String getServiceShorthand()
+    {
+        return serviceShorthand;
+    }
+
+    /**
+     * @return Returns the transaction id
+     */
+    public Long getTransactionId()
+    {
+        return transactionId;
+    }
+
+    /**
+     * @see java.lang.Object#toString()
+     */
+    public String toString()
+    {
+        return super.toString();
+    }
+
+    /**
+     * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
+     */
+    public Object invoke(Object proxy, Method method, Object [] args)
+        throws Throwable
+    {
+        Object result = null;
+        Object lock = null;
+
+        // create the interceptor context for current method call
+
+        AvalonInterceptorContext context = new AvalonInterceptorContextImpl(
+            this.getServiceName(),
+            this.getServiceShorthand(),
+            this.getServiceDelegate(),
+            method,
+            args
+            );
+
+        // if no transaction id is currently define we create a new one
+
+        boolean hasCreatedTransaction = this.createTransactionId(context);
+
+        try
+        {
+            context.incrementInvocationDepth();
+            lock = this.getReadWriteLock().getReadLock(this.serviceName);
+            this.onEntry(context);
+            result = method.invoke( this.getServiceDelegate(), args );
+            this.onExit(context,result);
+            return result;
+        }
+        catch (InvocationTargetException e)
+        {
+            this.onError(context,e.getTargetException());
+            throw e.getTargetException();
+        }
+        catch (Throwable t)
+        {
+            throw t;
+        }
+        finally
+        {
+            // return the read lock
+
+            this.getReadWriteLock().releaseLock(lock,this.serviceName);
+
+            // decrement the service invocation depth
+
+            context.decrementInvocationDepth();
+
+            // reset the transaction id if we have created it before
+
+            if( hasCreatedTransaction )
+            {
+                context.clearTransactionId();
+            }
+        }
+    }
+
+    /**
+     * Invoke the onEntry method on all service interceptors.
+     *
+     * @param context the current interceptor context
+     */
+    private void onEntry( AvalonInterceptorContext context )
+    {
+        for( int i=0; i<this.getServiceInterceptorList().length; i++ )
+        {
+            this.getServiceInterceptorList()[i].onEntry(context);
+        }
+    }
+
+    /**
+     * Invoke the onExit method on all service interceptors.
+     *
+     * @param context the current interceptor context
+     * @param result the result
+     */
+    private void onExit( AvalonInterceptorContext context, Object result )
+    {
+        for( int i=this.getServiceInterceptorList().length-1; i>=0; i-- )
+        {
+            this.getServiceInterceptorList()[i].onExit(context,result);
+        }
+    }
+
+    /**
+     * Invoke the onError method on all service interceptors.
+     *
+     * @param context the current interceptor context
+     * @param t the resulting exception
+     */
+    private void onError( AvalonInterceptorContext context, Throwable t )
+    {
+        for( int i=this.getServiceInterceptorList().length-1; i>=0; i-- )
+        {
+            this.getServiceInterceptorList()[i].onError(context,t);
+        }
+    }
+
+    /**
+     * @return Returns the readWriteLock.
+     */
+    private final ReadWriteLock getReadWriteLock()
+    {
+        return readWriteLock;
+    }
+
+    /**
+     * Creates a transaction id using the thread local storage
+     * @param context current interceptor context
+     * @return was a new transaction started
+     */
+    private boolean createTransactionId(AvalonInterceptorContext context)
+    {
+        Long currentTransactionId = null;
+
+        if( context.hasTransactionId() == false )
+        {
+            // create a new transaction id
+
+            currentTransactionId = new Long(
+                ++AvalonInterceptorInvocationHandler.transactionCounter
+                );
+
+            // store it in the TLS
+
+            context.setTransactionId(currentTransactionId);
+
+            return true;
+        }
+
+        return false;
+    }
+}

Modified: jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorService.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorService.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorService.java (original)
+++ jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/interceptor/AvalonInterceptorService.java Fri May  4 23:58:06 2007
@@ -1,60 +1,62 @@
-package org.apache.fulcrum.yaafi.framework.interceptor;
-
-/*
- * Copyright 2004 Apache Software Foundation
- * Licensed  under the  Apache License,  Version 2.0  (the "License");
- * you may not use  this file  except in  compliance with the License.
- * You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed  under the  License is distributed on an "AS IS" BASIS,
- * WITHOUT  WARRANTIES OR CONDITIONS  OF ANY KIND, either  express  or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-/**
- * Defining the common interface of all interceptors.
- *
- * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
- */
-
-public interface AvalonInterceptorService
-{
-    /** indicating entering a service method */
-    int ON_ENTRY = 0;
-
-    /** indicating exiting a service method without throwing an exception */
-    int ON_EXIT = 1;
-
-    /** indicating exiting a service method throwing an exception */
-    int ON_ERROR = 2;
-
-    /**
-     * Called before a service method is invoked.
-     *
-     * @param avalonInterceptorContext shared interceptor context
-     */
-    void onEntry( AvalonInterceptorContext avalonInterceptorContext );
-
-    /**
-     * Called after a service method was invoked.
-     *
-     * @param avalonInterceptorContext shared interceptor context
-     * @param result the result of the invocation
-     */
-    void onExit( AvalonInterceptorContext avalonInterceptorContext, Object result );
-
-    /**
-     * Called when a service method throws an exeption
-     *
-     * @param avalonInterceptorContext shared interceptor context
-     * @param t the resulting exception
-     */
-    void onError( AvalonInterceptorContext avalonInterceptorContext, Throwable t);
-}
\ No newline at end of file
+package org.apache.fulcrum.yaafi.framework.interceptor;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+/**
+ * Defining the common interface of all interceptors.
+ *
+ * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
+ */
+
+public interface AvalonInterceptorService
+{
+    /** indicating entering a service method */
+    int ON_ENTRY = 0;
+
+    /** indicating exiting a service method without throwing an exception */
+    int ON_EXIT = 1;
+
+    /** indicating exiting a service method throwing an exception */
+    int ON_ERROR = 2;
+
+    /**
+     * Called before a service method is invoked.
+     *
+     * @param avalonInterceptorContext shared interceptor context
+     */
+    void onEntry( AvalonInterceptorContext avalonInterceptorContext );
+
+    /**
+     * Called after a service method was invoked.
+     *
+     * @param avalonInterceptorContext shared interceptor context
+     * @param result the result of the invocation
+     */
+    void onExit( AvalonInterceptorContext avalonInterceptorContext, Object result );
+
+    /**
+     * Called when a service method throws an exeption
+     *
+     * @param avalonInterceptorContext shared interceptor context
+     * @param t the resulting exception
+     */
+    void onError( AvalonInterceptorContext avalonInterceptorContext, Throwable t);
+}

Modified: jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/locking/AvalonLoggerFacade.java
URL: http://svn.apache.org/viewvc/jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/locking/AvalonLoggerFacade.java?view=diff&rev=535465&r1=535464&r2=535465
==============================================================================
--- jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/locking/AvalonLoggerFacade.java (original)
+++ jakarta/turbine/fulcrum/trunk/yaafi/src/java/org/apache/fulcrum/yaafi/framework/locking/AvalonLoggerFacade.java Fri May  4 23:58:06 2007
@@ -1,140 +1,141 @@
-/*
- *
- * Copyright 1999-2002 The Apache Software Foundation 
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.apache.fulcrum.yaafi.framework.locking;
-
-import org.apache.avalon.framework.logger.Logger;
-
-
-/**
- * Facade for all kinds of logging engines.
- *   
- * @version $Revision: 1.2 $
- */
-public class AvalonLoggerFacade implements LoggerFacade 
-{
-    /** the logger to be used */    
-    private Logger logger;
-    
-    /**
-     * Constructor
-     * 
-     * @param logger the logger to use
-     */
-    public AvalonLoggerFacade(Logger logger)
-    {
-        this.logger = logger;
-    }
-    
-    /**
-     * Create a logger for the given name
-     * @param name the name
-     */
-    public LoggerFacade createLogger(String name)
-    {
-        return this;
-    }
-
-    /**
-     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#isFineEnabled()
-     */
-    public boolean isFineEnabled()
-    {
-        return this.logger.isDebugEnabled();
-    }
-    
-    /**
-     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#isFinerEnabled()
-     */
-    public boolean isFinerEnabled()
-    {        
-        return false;
-    }
-    
-    /**
-     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#isFinestEnabled()
-     */
-    public boolean isFinestEnabled()
-    {
-        return false;
-    }
-    
-    /**
-     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logFine(java.lang.String)
-     */
-    public void logFine(String message)
-    {
-        this.logger.debug(message);
-    }
-    
-    /**
-     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logFiner(java.lang.String)
-     */
-    public void logFiner(String message)
-    {
-        this.logger.debug(message);
-    }
-    
-    /**
-     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logFinest(java.lang.String)
-     */
-    public void logFinest(String message)
-    {
-        this.logger.debug(message);
-    }
-    
-    /**
-     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logInfo(java.lang.String)
-     */
-    public void logInfo(String message)
-    {
-        this.logger.info(message);
-    }
-    
-    /**
-     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logSevere(java.lang.String, java.lang.Throwable)
-     */
-    public void logSevere(String message, Throwable t)
-    {
-        this.logger.error(message,t);
-    }
-    
-    /**
-     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logSevere(java.lang.String)
-     */
-    public void logSevere(String message)
-    {
-        this.logger.error(message);
-    }
-    
-    /**
-     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logWarning(java.lang.String, java.lang.Throwable)
-     */
-    public void logWarning(String message, Throwable t)
-    {
-        this.logger.warn(message,t);
-    }
-    
-    /**
-     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logWarning(java.lang.String)
-     */
-    public void logWarning(String message)
-    {
-        this.logger.warn(message);
-    }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fulcrum.yaafi.framework.locking;
+
+import org.apache.avalon.framework.logger.Logger;
+
+
+/**
+ * Facade for all kinds of logging engines.
+ *
+ * @version $Revision: 1.2 $
+ */
+public class AvalonLoggerFacade implements LoggerFacade
+{
+    /** the logger to be used */
+    private Logger logger;
+
+    /**
+     * Constructor
+     *
+     * @param logger the logger to use
+     */
+    public AvalonLoggerFacade(Logger logger)
+    {
+        this.logger = logger;
+    }
+
+    /**
+     * Create a logger for the given name
+     * @param name the name
+     */
+    public LoggerFacade createLogger(String name)
+    {
+        return this;
+    }
+
+    /**
+     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#isFineEnabled()
+     */
+    public boolean isFineEnabled()
+    {
+        return this.logger.isDebugEnabled();
+    }
+
+    /**
+     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#isFinerEnabled()
+     */
+    public boolean isFinerEnabled()
+    {
+        return false;
+    }
+
+    /**
+     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#isFinestEnabled()
+     */
+    public boolean isFinestEnabled()
+    {
+        return false;
+    }
+
+    /**
+     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logFine(java.lang.String)
+     */
+    public void logFine(String message)
+    {
+        this.logger.debug(message);
+    }
+
+    /**
+     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logFiner(java.lang.String)
+     */
+    public void logFiner(String message)
+    {
+        this.logger.debug(message);
+    }
+
+    /**
+     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logFinest(java.lang.String)
+     */
+    public void logFinest(String message)
+    {
+        this.logger.debug(message);
+    }
+
+    /**
+     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logInfo(java.lang.String)
+     */
+    public void logInfo(String message)
+    {
+        this.logger.info(message);
+    }
+
+    /**
+     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logSevere(java.lang.String, java.lang.Throwable)
+     */
+    public void logSevere(String message, Throwable t)
+    {
+        this.logger.error(message,t);
+    }
+
+    /**
+     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logSevere(java.lang.String)
+     */
+    public void logSevere(String message)
+    {
+        this.logger.error(message);
+    }
+
+    /**
+     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logWarning(java.lang.String, java.lang.Throwable)
+     */
+    public void logWarning(String message, Throwable t)
+    {
+        this.logger.warn(message,t);
+    }
+
+    /**
+     * @see org.apache.fulcrum.yaafi.framework.locking.LoggerFacade#logWarning(java.lang.String)
+     */
+    public void logWarning(String message)
+    {
+        this.logger.warn(message);
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org