| | |
| | | package com.vci.server; |
| | | |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | |
| | | //import org.slf4j.Logger; |
| | | //import org.slf4j.LoggerFactory; |
| | | import com.vci.server.base.log.PltLogger; |
| | | import com.vci.server.base.persistence.dao.HibernateSessionFactory; |
| | | import com.vci.server.framework.FrameworkServiceImpl; |
| | | import com.vci.server.mw.ServerContextInterceptor; |
| | | import com.zeroc.Ice.Communicator; |
| | | import com.zeroc.Ice.Identity; |
| | | import com.zeroc.Ice.ObjectAdapter; |
| | |
| | | import com.zeroc.IceBox.Service; |
| | | |
| | | public class FrameBoxService implements Service { |
| | | private static final Logger LOGGER = LoggerFactory.getLogger(FrameBoxService.class); |
| | | //private static final Logger LOGGER = LoggerFactory.getLogger(FrameBoxService.class); |
| | | private static final PltLogger LOGGER = new PltLogger(FrameBoxService.class.getName()); |
| | | protected ObjectAdapter _adapter; |
| | | protected Identity id; |
| | | |
| | | @Override |
| | | public void start(String name, Communicator communicator, String[] args) { |
| | | LOGGER.info("start servant: FrameworkService"); |
| | | LOGGER.info("start servant: " + name); |
| | | |
| | | HibernateSessionFactory.getConfiguration(); |
| | | |
| | | // IceBox |
| | | Util.setProcessLogger(LOGGER); |
| | | // 创建objectAdapter,这里和service同名 |
| | | _adapter = communicator.createObjectAdapter(name); |
| | | // 创建servant |
| | | com.zeroc.Ice.Object object = new FrameworkServiceImpl(); |
| | | 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: FrameworkService"); |
| | | LOGGER.info("start servant success: " + name); |
| | | } |
| | | |
| | | @Override |