KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > phoenix > components > kernel > beanshell > BeanShellKernelProxy


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.phoenix.components.kernel.beanshell;
9
10 import java.io.File JavaDoc;
11 import org.apache.avalon.framework.configuration.Configuration;
12 import org.apache.avalon.framework.logger.Logger;
13 import org.apache.avalon.phoenix.interfaces.Application;
14 import org.apache.avalon.phoenix.interfaces.Kernel;
15 import org.apache.avalon.phoenix.metadata.SarMetaData;
16
17 public class BeanShellKernelProxy
18     implements Kernel
19 {
20     private transient Kernel m_kernel;
21
22     /**
23      * Construct a Proxy to the Kernel that does not implement all methods.
24      */

25     public BeanShellKernelProxy( final Kernel kernel )
26     {
27         m_kernel = kernel;
28     }
29
30     public void addApplication( final SarMetaData metaData,
31                                 final File JavaDoc workDirectory,
32                                 final ClassLoader JavaDoc classLoader,
33                                 final Logger hierarchy,
34                                 final Configuration server )
35         throws Exception JavaDoc
36     {
37         throw new UnsupportedOperationException JavaDoc( "This is not supported for non-kernel visitors" );
38     }
39
40     public void removeApplication( final String JavaDoc name )
41         throws Exception JavaDoc
42     {
43         m_kernel.removeApplication( name );
44     }
45
46     public Application getApplication( final String JavaDoc name )
47     {
48         return m_kernel.getApplication( name );
49     }
50
51     public String JavaDoc[] getApplicationNames()
52     {
53         return m_kernel.getApplicationNames();
54     }
55 }
56
Popular Tags