Пример #1
0
 @Override
 public void init() throws ServletException {
   super.init();
   ParameterContext pc = new ServletConfigParameterContext(getServletConfig(), true);
   String mappings = pc.getString("wsddBeanNamespaceMappings", "");
   initNamespaceMappings(mappings);
   this.defaultLoaders = ServicesUtil.getServiceFactoryLoaders(getClass());
   updateServiceDeployment();
 }
Пример #2
0
 @Override
 public void init(ServletConfig config) throws ServletException {
   try {
     ParameterContext c = new ServletContextParameterContext(config.getServletContext());
     String gridId = c.getValue("langrid.node.gridId");
     if (gridId == null) {
       logger.info("langrid.node.gridId is not set. ignore initializing domain.");
       return;
     }
     DaoFactory f = DaoFactory.createInstance();
     DaoContext dc = f.getDaoContext();
     jp.go.nict.langrid.dao.initializer.DomainInitializer.init(
         f,
         dc,
         gridId,
         c.getBoolean("dropAndCreate", false),
         config.getServletContext().getRealPath("/WEB-INF/init"));
     ProtocolDao dao = f.createProtocolDao();
     Set<String> protos =
         new HashSet<String>(
             CollectionUtil.collect(
                 dao.listAllProtocols(),
                 new Transformer<Protocol, String>() {
                   @Override
                   public String transform(Protocol value) throws TransformationException {
                     return value.getProtocolId();
                   }
                 }));
     if (!protos.contains(Protocols.SOAP_RPCENCODED)) {
       dao.addProtocol(new Protocol(Protocols.SOAP_RPCENCODED));
     }
     if (!protos.contains(Protocols.PROTOBUF_RPC)) {
       dao.addProtocol(new Protocol(Protocols.PROTOBUF_RPC));
     }
     if (!protos.contains(Protocols.JSON_RPC)) {
       dao.addProtocol(new Protocol(Protocols.JSON_RPC));
     }
   } catch (DaoException e) {
     throw new ServletException(e);
   } catch (IOException e) {
     throw new ServletException(e);
   } catch (SQLException e) {
     throw new ServletException(e);
   }
 }