KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > impl > model > seda > optimised > OptimisedProxyFactory


1 /*
2  * $Id: OptimisedProxyFactory.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.impl.model.seda.optimised;
12
13 import org.mule.config.pool.CommonsPoolProxyFactory;
14 import org.mule.impl.MuleDescriptor;
15 import org.mule.umo.UMOException;
16 import org.mule.umo.lifecycle.Callable;
17
18 /**
19  * Creates an optimised Mule proxy for pooling which does away with the reflection
20  * and inteception on objects
21  *
22  * @author <a HREF="mailto:ross.mason@symphonysoft.com">Ross Mason</a>
23  * @version $Revision: 3798 $
24  */

25 public class OptimisedProxyFactory extends CommonsPoolProxyFactory
26 {
27     public OptimisedProxyFactory(MuleDescriptor descriptor)
28     {
29         super(descriptor);
30     }
31
32     protected Object JavaDoc createProxy(Object JavaDoc component) throws UMOException
33     {
34         if (!(component instanceof Callable))
35         {
36             throw new IllegalArgumentException JavaDoc("Components for the Optimised Mule proxy must implement: "
37                                                + Callable.class.getName());
38         }
39         return new OptimisedMuleProxy((Callable)component, descriptor, pool);
40     }
41 }
42
Popular Tags