Examples of ServerService


Examples of org.apache.openejb.server.ServerService

        ejbJar.addEnterpriseBean(new StatelessBean(Target.class));
        assembler.createApplication(config.configureApplication(ejbJar));

        SystemInstance.get().setComponent(DiscoveryAgent.class, agent);

        final ServerService red = server(Host.RED);
        final ServerService blue = server(Host.BLUE);
        final ServerService green = server(Host.GREEN);

        red.start();
        blue.start();
        green.start();

        final TargetRemote target = getBean(red);

        assertEquals(Host.GREEN, target.kill(Host.RED, Host.BLUE).host);
        assertEquals(Host.GREEN, target.getHost());

        red.stop();
        blue.stop();
        green.stop();

        try {
            target.getHost();
            fail("EJBException should have been thrown");
        } catch (EJBException e) {
View Full Code Here

Examples of org.apache.openejb.server.ServerService

        final Context context = new InitialContext(props);
        return (TargetRemote) context.lookup("TargetRemote");
    }

    private ServerService server(final Host host) throws Exception {
        ServerService server = new EjbServer();

        server = new HostFilter(server, host);

        server = new ServiceDaemon(server, 0, "localhost");

        server = new AgentFilter(server, agent, host);

        server.init(new Properties());

        return server;
    }
View Full Code Here

Examples of org.apache.openejb.server.ServerService

            manager.init();
            manager.start(false);
        } else {
            // WS
            try {
                ServerService cxfService = (ServerService) cl.loadClass("org.apache.openejb.server.cxf.CxfService").newInstance();
                cxfService.init(properties);
                cxfService.start();
                services.add(cxfService);
            } catch (ClassNotFoundException ignored) {
            } catch (Exception e) {
                Logger logger = Logger.getInstance(LogCategory.OPENEJB_STARTUP, getClass());
                logger.error("Webservices failed to start", e);
            }

            // REST
            try {
                ServerService restService = (ServerService) cl.loadClass("org.apache.openejb.server.cxf.rs.CxfRSService").newInstance();
                restService.init(properties);
                restService.start();
                services.add(restService);
            } catch (ClassNotFoundException ignored) {
            } catch (Exception e) {
                logger.error("REST failed to start", e);
            }
View Full Code Here

Examples of org.auraframework.service.ServerService

      Map<String, Object> attributesC = Maps.newHashMap();
      attributesC.put("attr", "attrC");
    Component sharedCmp = Aura.getInstanceService().getInstance("ifTest:testIfWithModel", ComponentDef.class,
                attributes);
      StringWriter sw = new StringWriter();
        ServerService ss = Aura.getServerService();
        Action a = new EmptyAction(sw,"first action");
        Action b = new EmptyAction(sw,"second action");
        Action c = new EmptyAction(sw,"third action");
        Action d = new ShareCmpAction("d",a,sharedCmp,attributesA);
        Action e = new ShareCmpAction("e",b,sharedCmp,attributesB);
        Action f = new ShareCmpAction("f",c,sharedCmp,attributesC);
        List<Action> actions = Lists.newArrayList(d,e,f);
        Message message = new Message(actions);
        //run the list of actions.
        ss.run(message, Aura.getContextService().getCurrentContext(), sw, null);
       
        //sanity check, sharedCmp should have the latest attribute value.
        //this has nothing to do with the fix though
        assertEquals("attrC",sharedCmp.getAttributes().getValue("attr"));
        //Here are the checks for fix
View Full Code Here

Examples of org.auraframework.service.ServerService

     * in the old way we won't have anything in string writer/response until Action3 is finished.
     */
    public void testMultipleActions() throws Exception {
      Aura.getContextService().startContext(Mode.UTEST, Format.JSON, Authentication.AUTHENTICATED);
      StringWriter sw = new StringWriter();
        ServerService ss = Aura.getServerService();
        Action a = new EmptyAction(sw,"first action");
        Action b = new EmptyAction(sw,"second action");
        Action c = new EmptyAction(sw,"third action");
        List<Action> actions = Lists.newArrayList(a,b,c);
        Message message = new Message(actions);
        //run the list of actions.
        ss.run(message, Aura.getContextService().getCurrentContext(), sw, null);
        String returnValuea = "{\"actions\":[";
        String returnValueb = returnValuea+"{\"action\":\"firstaction\"}";
        String returnValuec = returnValueb+",{\"action\":\"secondaction\"}";
       
        List<String> returnValueList = Arrays.asList(returnValuea,returnValueb,returnValuec);
View Full Code Here

Examples of org.auraframework.service.ServerService

     * but response keep the info from previous run, so we are good
     */
    public void testSameActionTwice() throws Exception {
      Aura.getContextService().startContext(Mode.UTEST, Format.JSON, Authentication.AUTHENTICATED);
      StringWriter sw = new StringWriter();
        ServerService ss = Aura.getServerService();
        Action a = new EmptyAction(sw,"first action");
        Action b = new EmptyAction(sw,"second action");
        List<Action> actions = Lists.newArrayList(a,b,a,b);
        Message message = new Message(actions);
        ss.run(message, Aura.getContextService().getCurrentContext(), sw, null);
        assertTrue(((EmptyAction)a).getCount()==2);
        assertTrue(((EmptyAction)b).getCount()==2);
        //in the old way since we output action info into response after all actions finish running, the previous run's info will get overwrited
        //but this is not the case now
        //we need to verify when same action run twice, and something about the action changed between the two runs --like the parameter,
View Full Code Here

Examples of org.auraframework.service.ServerService

     * We carefully test only the parts that we care about for ServerService.
     */
    public void testSimpleAction() throws Exception {
        Aura.getContextService().startContext(Mode.UTEST, Format.JSON, Authentication.AUTHENTICATED);

        ServerService ss = Aura.getServerService();
        Action a = new EmptyAction();
        List<Action> actions = Lists.newArrayList(a);
        Message message = new Message(actions);
        StringWriter sw = new StringWriter();
        ss.run(message, Aura.getContextService().getCurrentContext(), sw, null);
        validateEmptyActionSerialization(sw.toString(), null, Arrays.asList("simpleaction"));
    }
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.tunnel.ServerService

  protected void setServerInput() {

    if (services != null && !services.isEmpty()) {
      serviceViewer.setInput(services);
      ServerService initialSelection = services.get(0);
      if (serviceContext != null) {
        for (ServerService serv : services) {
          if (serv.getServiceInfo().equals(serviceContext)) {
            initialSelection = serv;
            break;
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.tunnel.ServerService

   * selected command. False will ONLY edit an existing command, if one is
   * currently selected. Otherwise it will add a new command.
   */
  protected void addOrEditCommand(boolean add) {

    ServerService service = getSelectedService();
    if (service != null) {
      ServiceCommand serviceCommandToEdit = !add ? getSelectedCommand() : null;

      ServiceCommandWizard wizard = new ServiceCommandWizard(serviceCommands, service, serviceCommandToEdit);
      Shell shell = getShell();

      if (shell != null) {
        WizardDialog dialog = new WizardDialog(shell, wizard);
        if (dialog.open() == Window.OK) {

          ServiceCommand editedCommand = wizard.getEditedServiceCommand();

          if (editedCommand != null) {
            // Add the new one
            boolean added = new ServiceCommandManager(serviceCommands).addCommand(service.getServiceInfo(),
                editedCommand);

            if (!added) {
              notifyStatusChange(CloudFoundryPlugin.getErrorStatus(Messages.ServiceTunnelCommandPart_ERROR_FAIL_TO_ADD
                  + editedCommand.getDisplayName()));
View Full Code Here

Examples of org.cloudfoundry.ide.eclipse.server.core.internal.tunnel.ServerService

    }
  }

  protected void deleteCommand(ServiceCommand toDelete) {
    ServerService serverService = getSelectedService();
    if (toDelete != null && serverService != null) {
      List<ServiceCommand> commands = serverService.getCommands();
      List<ServiceCommand> newCommands = new ArrayList<ServiceCommand>();
      if (commands != null) {
        for (ServiceCommand existingCommand : commands) {
          if (!existingCommand.equals(toDelete)) {
            newCommands.add(existingCommand);
          }
        }

      }
      serverService.setCommands(newCommands);

      setServiceCommandInput(serverService, null);

    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.