KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > net > axis > AttacheableService


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 // $Id: AttacheableService.java,v 1.8 2004/03/26 03:56:38 starksm Exp $
9

10 package org.jboss.net.axis;
11
12 import javax.naming.Reference JavaDoc;
13 import javax.naming.Referenceable JavaDoc;
14 import javax.naming.StringRefAddr JavaDoc;
15
16 /**
17  * <p>The attacheable service implementation
18  * allows to bind axis service instances into JNDI
19  * without loosing the configuration link to their engine/deployer.</p>
20  * <p>Configuration pointers are reinstalled
21  * by a dedicated context attribute that allows to identify a
22  * target configuration when deserialized by the associated
23  * ServiceFactory.</p>
24  * @see ServiceFactory
25  * @since 26.04.02
26  * @author <a HREF="mailto:Christoph.Jung@infor.de">Christoph G. Jung</a>
27  * @version $Revision: 1.8 $
28  */

29
30 public class AttacheableService implements Referenceable JavaDoc
31 {
32
33    //
34
// Attributes
35
//
36

37    /**
38     * the real axis service implementation that
39     * regularly looses its configuration
40     */

41
42    protected String JavaDoc serviceClass;
43
44    /** this is what we need to find the important part, which is the
45     * engine configuration, again.
46     */

47    protected String JavaDoc rootContext;
48
49    //
50
// Constructors
51
//
52

53    /**
54     * Creates a new ServiceFactory.
55     * @param service the axis service
56     */

57
58    public AttacheableService(String JavaDoc serviceClass, String JavaDoc rootContext)
59    {
60       this.serviceClass = serviceClass;
61       this.rootContext = rootContext;
62    }
63
64    //
65
// Naming API
66
//
67

68    public Reference JavaDoc getReference()
69    {
70       Reference JavaDoc myRef =
71          new Reference JavaDoc(serviceClass, ServiceFactory.class.getName(), null);
72       myRef.add(new StringRefAddr JavaDoc(Constants.CONFIGURATION_CONTEXT, rootContext));
73       return myRef;
74    }
75
76 }
77
Popular Tags