| | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | import com.vci.server.base.persistence.dao.HibernateSessionFactory; |
| | | import com.vci.server.mw.ServerContextInterceptor; |
| | | import com.vci.server.query.ObjectQueryServiceImpl; |
| | | import com.zeroc.Ice.Communicator; |
| | | import com.zeroc.Ice.Identity; |
| | |
| | | |
| | | @Override |
| | | public void start(String name, Communicator communicator, String[] args) { |
| | | LOGGER.info("start servant: OMDService"); |
| | | LOGGER.info("start servant: " + name); |
| | | |
| | | HibernateSessionFactory.getConfiguration(); |
| | | |
| | | // IceBox |
| | | // 创建objectAdapter,这里和service同名 |
| | | _adapter = communicator.createObjectAdapter(name); |
| | | // 创建servant |
| | | com.zeroc.Ice.Object object = new ObjectQueryServiceImpl(); |
| | | id = Util.stringToIdentity(name); |
| | | // _adapter.add(object, communicator.stringToIdentity(name)); |
| | | _adapter.add(object, id); |
| | | _adapter.add(new ServerContextInterceptor(object), Util.stringToIdentity(name)); |
| | | // 激活 |
| | | _adapter.activate(); |
| | | LOGGER.info("start servant success: OMDService"); |
| | | LOGGER.info("start servant success: " + name); |
| | | } |
| | | |
| | | @Override |