01: /*
02: * The contents of this file are subject to the Sapient Public License
03: * Version 1.0 (the "License"); you may not use this file except in compliance
04: * with the License. You may obtain a copy of the License at
05: * http://carbon.sf.net/License.html.
06: *
07: * Software distributed under the License is distributed on an "AS IS" basis,
08: * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
09: * the specific language governing rights and limitations under the License.
10: *
11: * The Original Code is The Carbon Component Framework.
12: *
13: * The Initial Developer of the Original Code is Sapient Corporation
14: *
15: * Copyright (C) 2003 Sapient Corporation. All Rights Reserved.
16: */
17:
18: package org.sape.carbon.services.management.interceptor;
19:
20: import org.sape.carbon.core.component.ComponentConfiguration;
21: import org.sape.carbon.core.component.FunctionalInterface;
22: import org.sape.carbon.core.component.proxy.ComponentProxyInvocationHandler;
23: import org.sape.carbon.core.component.proxy.Decorator;
24: import org.sape.carbon.core.component.proxy.DecoratorFactory;
25: import org.sape.carbon.core.config.Configuration;
26:
27: /**
28: * <P>This factory builds MBeanAssistants for a component.</P>
29: *
30: *
31: * @since carbon 1.0
32: * @author Greg Hinkle, January 2002
33: * @version $Revision: 1.4 $($Author: dvoet $ / $Date: 2003/05/05 21:21:33 $)
34: * <br>Copyright 2002 Sapient
35: */
36: public class ManagementInterceptorFactory implements DecoratorFactory {
37:
38: /**
39: * <p>Constructs a component interceptor. The parameters of this method
40: * encompass all the information known about a component at the time
41: * it is constructed.</p>
42: *
43: * @param functionalImplementation The functional implementation of the
44: * component. This is supplied for cases where the interceptor needs to
45: * access the functional implementation object directly.
46: * @param componentConfiguration configuartion of the component which being
47: * built
48: * @param proxyInvocationHandler the invocation handler object that backs
49: * the component that this interceptor is being built for
50: * @param decoratorConfiguration a custom configuration object for the
51: * interceptor
52: * @return The <CODE>Decorator</CODE> that was built by this factory
53: */
54: public Decorator getInstance(
55: FunctionalInterface functionalImplementation,
56: ComponentConfiguration componentConfiguration,
57: ComponentProxyInvocationHandler proxyInvocationHandler,
58: Configuration decoratorConfiguration) {
59:
60: ManagementInterceptorConfiguration config = (ManagementInterceptorConfiguration) decoratorConfiguration;
61:
62: return new DefaultManagementInterceptorImpl(config,
63: componentConfiguration.getFunctionalInterface());
64: }
65:
66: }
|