49 |
import org.omg.CORBA.NVList; |
import org.omg.CORBA.NVList; |
50 |
import org.omg.CORBA.NamedValue; |
import org.omg.CORBA.NamedValue; |
51 |
import org.omg.CORBA.ORB; |
import org.omg.CORBA.ORB; |
52 |
|
import org.omg.CORBA.ORBPackage.InvalidName; |
53 |
import org.omg.CORBA.Request; |
import org.omg.CORBA.Request; |
54 |
import org.omg.CORBA.StructMember; |
import org.omg.CORBA.StructMember; |
55 |
import org.omg.CORBA.TCKind; |
import org.omg.CORBA.TCKind; |
56 |
import org.omg.CORBA.TypeCode; |
import org.omg.CORBA.TypeCode; |
|
import org.omg.CORBA.UnionMember; |
|
|
|
|
|
import org.omg.CORBA.ORBPackage.InvalidName; |
|
57 |
import org.omg.CORBA.TypeCodePackage.BadKind; |
import org.omg.CORBA.TypeCodePackage.BadKind; |
58 |
|
import org.omg.CORBA.UnionMember; |
59 |
import org.omg.CORBA.portable.OutputStream; |
import org.omg.CORBA.portable.OutputStream; |
60 |
|
import org.omg.CORBA.portable.ValueFactory; |
61 |
|
|
62 |
import java.applet.Applet; |
import java.applet.Applet; |
63 |
|
|
64 |
|
import java.util.Hashtable; |
65 |
import java.util.Properties; |
import java.util.Properties; |
66 |
|
|
67 |
/** |
/** |
81 |
* @author Audrius Meskauskas (AudriusA@Bioinformatics.org) |
* @author Audrius Meskauskas (AudriusA@Bioinformatics.org) |
82 |
*/ |
*/ |
83 |
public class Restricted_ORB |
public class Restricted_ORB |
84 |
extends ORB |
extends org.omg.CORBA_2_3.ORB |
85 |
{ |
{ |
86 |
/** |
/** |
87 |
* The singleton instance of this ORB. |
* The singleton instance of this ORB. |
89 |
public static final ORB Singleton = new Restricted_ORB(); |
public static final ORB Singleton = new Restricted_ORB(); |
90 |
|
|
91 |
/** |
/** |
92 |
|
* The value factories. |
93 |
|
*/ |
94 |
|
protected Hashtable factories = new Hashtable(); |
95 |
|
|
96 |
|
/** |
97 |
* Create a new instance of the RestrictedORB. This is used |
* Create a new instance of the RestrictedORB. This is used |
98 |
* in derived classes only. |
* in derived classes only. |
99 |
*/ |
*/ |
110 |
/** {@inheritDoc} */ |
/** {@inheritDoc} */ |
111 |
public Any create_any() |
public Any create_any() |
112 |
{ |
{ |
113 |
return new gnuAny(); |
gnuAny any = new gnuAny(); |
114 |
|
any.setOrb(this); |
115 |
|
return any; |
116 |
} |
} |
117 |
|
|
118 |
/** {@inheritDoc} */ |
/** {@inheritDoc} */ |
418 |
{ |
{ |
419 |
no(); |
no(); |
420 |
} |
} |
421 |
|
|
422 |
|
/** |
423 |
|
* Register the value factory under the given repository id. |
424 |
|
*/ |
425 |
|
public ValueFactory register_value_factory(String repository_id, |
426 |
|
ValueFactory factory |
427 |
|
) |
428 |
|
{ |
429 |
|
factories.put(repository_id, factory); |
430 |
|
return factory; |
431 |
|
} |
432 |
|
|
433 |
|
/** |
434 |
|
* Unregister the value factroy. |
435 |
|
*/ |
436 |
|
public void unregister_value_factory(String id) |
437 |
|
{ |
438 |
|
factories.remove(id); |
439 |
|
} |
440 |
|
|
441 |
|
/** |
442 |
|
* Look for the value factory for the value, having the given repository id. |
443 |
|
* The implementation checks for the registered value factories first. |
444 |
|
* If none found, it tries to load and instantiate the class, mathing the |
445 |
|
* given naming convention. If this faild, null is returned. |
446 |
|
* |
447 |
|
* @param repository_id a repository id. |
448 |
|
* |
449 |
|
* @return a found value factory, null if none. |
450 |
|
*/ |
451 |
|
public ValueFactory lookup_value_factory(String repository_id) |
452 |
|
{ |
453 |
|
ValueFactory f = (ValueFactory) factories.get(repository_id); |
454 |
|
if (f != null) |
455 |
|
return f; |
456 |
|
|
457 |
|
f = (ValueFactory) ObjectCreator.createObject(repository_id, "DefaultFactory"); |
458 |
|
if (f != null) |
459 |
|
factories.put(repository_id, f); |
460 |
|
|
461 |
|
return f; |
462 |
|
} |
463 |
} |
} |