FileDocCategorySizeDatePackage
IORFactories.javaAPI DocJava SE 5 API5188Fri Aug 26 14:54:36 BST 2005com.sun.corba.se.spi.ior

IORFactories

public class IORFactories extends Object
This class provides a number of factory methods for creating various IOR SPI classes which are not subclassed for specific protocols. The following types must be created using this class:
  • ObjectId
  • ObjectKey
  • IOR
  • IORTemplate

Fields Summary
Constructors Summary
private IORFactories()

Methods Summary
public static IORgetIOR(org.omg.CORBA.Object obj)

	return ORBUtility.getIOR( obj ) ;
    
public static IORFactorygetIORFactory(org.omg.PortableInterceptor.ObjectReferenceTemplate ort)

	if (ort instanceof ObjectReferenceTemplateImpl) {
	    ObjectReferenceTemplateImpl orti = 
		(ObjectReferenceTemplateImpl)ort ;
	    return orti.getIORFactory() ;
	}

	throw new BAD_PARAM() ;
    
public static IORTemplateListgetIORTemplateList(org.omg.PortableInterceptor.ObjectReferenceFactory orf)

	if (orf instanceof ObjectReferenceProducerBase) {
	    ObjectReferenceProducerBase base =
		(ObjectReferenceProducerBase)orf ;
	    return base.getIORTemplateList() ;
	}

	throw new BAD_PARAM() ;
    
public static IORmakeIOR(com.sun.corba.se.spi.orb.ORB orb, java.lang.String typeid)
Create an empty IOR for the given orb and typeid. The result is mutable.

	return new IORImpl( orb, typeid ) ;
    
public static IORmakeIOR(com.sun.corba.se.spi.orb.ORB orb)
Create an empty IOR for the given orb with a null typeid. The result is mutable.

	return new IORImpl( orb ) ;
    
public static IORmakeIOR(org.omg.CORBA_2_3.portable.InputStream is)
Read an IOR from an InputStream. ObjectKeys are not shared.

	return new IORImpl( is ) ;
    
public static IORTemplatemakeIORTemplate(ObjectKeyTemplate oktemp)
Create an IORTemplate with the given ObjectKeyTemplate. The result is mutable.

	return new IORTemplateImpl( oktemp ) ;
    
public static IORTemplatemakeIORTemplate(org.omg.CORBA_2_3.portable.InputStream is)
Read an IORTemplate from an InputStream.

	return new IORTemplateImpl( is ) ;
    
public static IORTemplateListmakeIORTemplateList(org.omg.CORBA_2_3.portable.InputStream is)

	return new IORTemplateListImpl( is ) ;
    
public static IORTemplateListmakeIORTemplateList()

	return new IORTemplateListImpl() ;
    
public static ObjectIdmakeObjectId(byte[] id)
Create an ObjectId for the given byte sequence.

	return new ObjectIdImpl( id ) ;
    
public static ObjectKeymakeObjectKey(ObjectKeyTemplate oktemp, ObjectId oid)
Create an ObjectKey for the given ObjectKeyTemplate and ObjectId.

	return new ObjectKeyImpl( oktemp, oid ) ;
    
public static ObjectKeyFactorymakeObjectKeyFactory(com.sun.corba.se.spi.orb.ORB orb)

	return new ObjectKeyFactoryImpl( orb ) ;
    
public static org.omg.CORBA.ObjectmakeObjectReference(IOR ior)

	return ORBUtility.makeObjectReference( ior ) ;
    
public static org.omg.PortableInterceptor.ObjectReferenceFactorymakeObjectReferenceFactory(com.sun.corba.se.spi.orb.ORB orb, IORTemplateList iortemps)

	return new ObjectReferenceFactoryImpl( orb, iortemps ) ;
    
public static org.omg.PortableInterceptor.ObjectReferenceTemplatemakeObjectReferenceTemplate(com.sun.corba.se.spi.orb.ORB orb, IORTemplate iortemp)

	return new ObjectReferenceTemplateImpl( orb, iortemp ) ;
    
public static voidregisterValueFactories(com.sun.corba.se.spi.orb.ORB orb)
This method must be called in order to register the value factories for the ObjectReferenceTemplate and ObjectReferenceFactory value types.

	// Create and register the factory for the Object Reference Template
	// implementation.
	ValueFactory vf = new ValueFactory() {
	    public Serializable read_value( InputStream is ) 
	    {
		return new ObjectReferenceTemplateImpl( is ) ;
	    }
	} ;

	orb.register_value_factory( ObjectReferenceTemplateImpl.repositoryId, vf ) ;

	// Create and register the factory for the Object Reference Factory
	// implementation.
	vf = new ValueFactory() {
	    public Serializable read_value( InputStream is ) 
	    {
		return new ObjectReferenceFactoryImpl( is ) ;
	    }
	} ;

	orb.register_value_factory( ObjectReferenceFactoryImpl.repositoryId, vf ) ;