01: /**
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */package org.apache.openejb.util.proxy;
17:
18: import java.util.Properties;
19:
20: import org.apache.openejb.OpenEJBException;
21:
22: public interface ProxyFactory {
23:
24: public void init(Properties props) throws OpenEJBException;
25:
26: public InvocationHandler getInvocationHandler(Object proxy)
27: throws IllegalArgumentException;
28:
29: public Object setInvocationHandler(Object proxy,
30: InvocationHandler handler) throws IllegalArgumentException;
31:
32: public Class getProxyClass(Class interfce)
33: throws IllegalArgumentException;
34:
35: public Class getProxyClass(Class[] interfaces)
36: throws IllegalArgumentException;
37:
38: /*
39: * Returns true if and only if the specified class was dynamically generated to be a proxy class using the getProxyClass method or the newProxyInstance method.
40: */
41: public boolean isProxyClass(Class cl);
42:
43: /*
44: * Returns an instance of a proxy class for the specified interface that dispatches method invocations to
45: * the specified invocation handler.
46: */
47: public Object newProxyInstance(Class interfce, InvocationHandler h)
48: throws IllegalArgumentException;
49:
50: /*
51: * Returns an instance of a proxy class for the specified interface that dispatches method invocations to
52: * the specified invocation handler.
53: */
54: public Object newProxyInstance(Class[] interfaces,
55: InvocationHandler h) throws IllegalArgumentException;
56:
57: public Object newProxyInstance(Class proxyClass)
58: throws IllegalArgumentException;
59: }
|