package com.vci.server.workflow.server;
|
|
import org.omg.PortableServer.POA;
|
import org.omg.PortableServer.Servant;
|
|
import com.vci.common.log.ServerWithLog4j;
|
import com.vci.server.base.corbautil.NameServiceUtility;
|
|
public class WorkFlowServer {
|
//protected static NameServiceUtility nsu = null;
|
private static String WFSERVICENAME = "wfService";
|
|
/**
|
* @param args
|
*/
|
public static void main(String[] args) {
|
try
|
{
|
// nsu = new NameServiceUtility();
|
// nsu.InitORBEnv();
|
// nsu.InitORB();
|
// nsu.InitNameContext();
|
// POA poa = nsu.getPoa();
|
//
|
// Servant ob =(Servant) (new WorkflowServiceImpl());
|
// poa.activate_object(ob);
|
// nsu.bindToNs(WFSERVICENAME, poa.servant_to_reference(ob));
|
// ServerWithLog4j.logger.info("bind " + WFSERVICENAME + " OK!");
|
//
|
// nsu.getOrb().run();
|
}
|
catch(Exception e)
|
{
|
e.printStackTrace();
|
}
|
finally
|
{
|
clearAll();
|
nsu.close();
|
}
|
|
}
|
|
/**
|
* 解除绑定工作流Corba服务
|
*/
|
protected static void clearAll()
|
{
|
try
|
{
|
nsu.unBindToNs(WFSERVICENAME);
|
}
|
catch(Exception e)
|
{
|
e.printStackTrace();
|
}
|
}
|
}
|