KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > orb > iiop > IIOPFactories


1 package org.jacorb.orb.iiop;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1999-2004 Gerald Brose
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  *
22  */

23
24 import org.apache.avalon.framework.configuration.*;
25
26 import org.omg.IOP.*;
27 import org.omg.ETF.*;
28
29 /**
30  * @author Andre Spiegel
31  * @version $Id: IIOPFactories.java,v 1.6 2004/08/25 09:31:41 simon.mcqueen Exp $
32  */

33 public class IIOPFactories
34     extends org.jacorb.orb.etf.FactoriesBase
35 {
36     static
37     {
38         connectionClz = ClientIIOPConnection.class;
39         listenerClz = IIOPListener.class;
40         profileClz = IIOPProfile.class;
41     }
42
43 /* public Profile demarshal_profile(TaggedProfileHolder tagged_profile,
44                                       TaggedComponentSeqHolder components)
45     {
46         if (tagged_profile.value.tag != TAG_INTERNET_IOP.value)
47         {
48             throw new org.omg.CORBA.BAD_PARAM
49                 ("wrong profile for IIOP transport, tag: "
50                  + tagged_profile.value.tag);
51         }
52         else
53         {
54             IIOPProfile result =
55                 new IIOPProfile(tagged_profile.value.profile_data);
56             try
57             {
58                 result.configure(configuration);
59             }
60             catch(ConfigurationException e)
61             {
62                 throw new org.omg.CORBA.INTERNAL("ConfigurationException: " + e.getMessage());
63             }
64
65             components.value = result.getComponents().asArray();
66             return result;
67         }
68     }*/

69
70     public int profile_tag()
71     {
72         return org.omg.IOP.TAG_INTERNET_IOP.value;
73     }
74
75     public Profile decode_corbaloc (String JavaDoc corbaloc)
76     {
77         int colon = corbaloc.indexOf (':');
78         String JavaDoc token = corbaloc.substring (0,colon).toLowerCase();
79         if (token.length() == 0 ||
80             token.equals ("iiop") ||
81             token.equals ("ssliop"))
82         {
83             IIOPProfile result = new IIOPProfile(corbaloc);
84             try
85             {
86                 result.configure(configuration);
87             }
88             catch(ConfigurationException e)
89             {
90                 throw new org.omg.CORBA.INTERNAL JavaDoc("ConfigurationException: " + e.getMessage());
91             }
92
93             return result;
94         }
95         else
96             return null;
97     }
98 }
99
Popular Tags