public class SessionFactory extends Object
Constructor and Description |
---|
SessionFactory() |
Modifier and Type | Method and Description |
---|---|
static BaseSession |
get(String className)
Used to obtain a non-remotable initial reference to a session object.
|
static BaseSession |
get(String className,
NXRemotableObject.RemotingProtocol remotingProtocol)
Used to obtain an initial reference to a session object.
|
public static BaseSession get(String className) throws NXException
Session theSession = (Session)SessionFactory.get("Session"); UFSession ufSession = (UFSession)SessionFactory.get("UFSession");
className
- The name of the class you want to obtain a reference to.
The class must inherit from BaseSession.NXException
public static BaseSession get(String className, NXRemotableObject.RemotingProtocol remotingProtocol) throws NXException, RemoteException
NXRemotableObject.RemotingProtocol remotingProtocol = new NXRemotableObject.RemotingProtocol(); Session theSession = (Session)SessionFactory.get("Session", remotingProtocol); UFSession ufSession = (UFSession)SessionFactory.get("UFSession", remotingProtocol);
className
- The name of the class you want to obtain a reference to.
The class must inherit from BaseSession.remotingProtocol
- Specifies parameters that will be used with RMI remoting for the
BaseSession object that is returned. All remotable objects obtained from the BaseSession
object will also use this remoting protocol. If remotingProtocol is null, the object
can not be used with RMI; it can be used locally only.NXException
RemoteException
NXRemotableObject.RemotingProtocol
Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.