/[classpath]/classpath/gnu/CORBA/Restricted_ORB.java
ViewVC logotype

Diff of /classpath/gnu/CORBA/Restricted_ORB.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by audriusa, Mon May 23 20:00:45 2005 UTC revision 1.3 by audriusa, Sat Jun 11 15:00:32 2005 UTC
# Line 49  import org.omg.CORBA.NO_IMPLEMENT; Line 49  import org.omg.CORBA.NO_IMPLEMENT;
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  /**  /**
# Line 80  import java.util.Properties; Line 81  import java.util.Properties;
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.
# Line 88  public class Restricted_ORB Line 89  public class Restricted_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     */     */
# Line 104  public class Restricted_ORB Line 110  public class Restricted_ORB
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} */
# Line 410  public class Restricted_ORB Line 418  public class Restricted_ORB
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  }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26