Examples of ClientThread


Examples of com.art.anette.server.network.ClientThread

     * @param sdbc die ServerDBControl des Employees
     * @param obj  Das Object.
     * @throws NetworkException Tritt auf, falls das Senden fehlschlägt.
     */
    public boolean send(ServerDBControl sdbc, Response obj) throws NetworkException {
        final ClientThread clientThread = sdbcs.get(sdbc);
        if (clientThread == null) {
            return false;
        }

        try {
            clientThread.send(obj);
            return true;
        } catch (IOException ex) {
            if (NetworkControl.wasCausedByClosedSocket(ex)) {
                logger.info("Client closed the connection");
                return false;
View Full Code Here

Examples of net.myrrix.online.ClientThread

 
  private void configureClientThread(ServletContext context,
                                     String bucket,
                                     String instanceID,
                                     MyrrixRecommender recommender) {
    ClientThread theThread;
    try {
      theThread = loadClientThreadClass(context, bucket, instanceID);
    } catch (IOException ioe) {
      throw new IllegalStateException(ioe);
    } catch (ClassNotFoundException cnfe) {
      throw new IllegalStateException(cnfe);
    }
    if (theThread != null) {
      theThread.setRecommender(recommender);       
      clientThread = theThread;
      new Thread(theThread, "MyrrixClientThread").start();
    }
  }
View Full Code Here

Examples of net.myrrix.online.ClientThread

    }
   
    log.info("Loading class {} from {}, copied from remote JAR at key {}",
             clientThreadClassName, tempResourceFile, tempResourceFile);
   
    ClientThread clientThreadRunnable =
        ClassUtils.loadFromRemote(clientThreadClassName, ClientThread.class, tempResourceFile.toURI().toURL());

    if (!tempResourceFile.delete()) {
      log.info("Could not delete {}", tempResourceFile);
    }
View Full Code Here

Examples of net.myrrix.online.ClientThread

  @Override
  public void contextDestroyed(ServletContextEvent event) {
    log.info("Uninitializing Myrrix in servlet context...");
   
    ClientThread theClientThread = clientThread;
    if (theClientThread != null) {
      try {
        theClientThread.close();
      } catch (IOException e) {
        log.warn("Error while closing client thread", e);
      }
    }
   
View Full Code Here

Examples of org.geotools.referencing.factory.epsg.HsqlDialectEpsgMediatorStressTest.ClientThread

    }

    public void testLeak() throws Throwable {
        TestRunnable runners[] = new TestRunnable[RUNNER_COUNT];
        for (int i = 0; i < RUNNER_COUNT; i++) {
            ClientThread thread = new HsqlDialectEpsgMediatorStressTest.ClientThread(i, mediator);
            thread.iterations = ITERATIONS;
            runners[i] = thread;
        }
        MultiThreadedTestRunner mttr = new MultiThreadedTestRunner(runners, null);
        mttr.runTestRunnables(MAX_TIME);
       
        //count exceptions and metrics
        int exceptions = 0;
        for (int i = 0; i < RUNNER_COUNT; i++) {
            ClientThread thread = (ClientThread) runners[i];
            exceptions += thread.exceptions;
        }
        //destroy the mediator, check for open connections or exceptions
        mediator.dispose();
        assertEquals(0, datasource.getNumActive());
View Full Code Here

Examples of org.geotools.referencing.factory.epsg.OracleDialectEpsgMediatorOnlineStressTest.ClientThread

    }

    public void testLeak() throws Throwable {
        TestRunnable runners[] = new TestRunnable[RUNNER_COUNT];
        for (int i = 0; i < RUNNER_COUNT; i++) {
            ClientThread thread = new OracleDialectEpsgMediatorOnlineStressTest.ClientThread(i, mediator);
            thread.iterations = ITERATIONS;
            runners[i] = thread;
        }
        MultiThreadedTestRunner mttr = new MultiThreadedTestRunner(runners, null);
        mttr.runTestRunnables(MAX_TIME);
       
        //count exceptions and metrics
        int exceptions = 0;
        for (int i = 0; i < RUNNER_COUNT; i++) {
            ClientThread thread = (ClientThread) runners[i];
            exceptions += thread.exceptions;
        }
        //destroy the mediator, check for open connections or exceptions
        mediator.dispose();
        assertEquals(0, wrappedDataSource.getNumActive());
View Full Code Here

Examples of ptolemy.distributed.client.ClientThread

            Iterator firings = level.firingIterator();

            while (firings.hasNext()) {
                Firing firing = (Firing) firings.next();
                Actor actor = firing.getActor();
                ClientThread clientThread = (ClientThread) actorsThreadsMap
                        .get(actor);
                clientThread.setIterationCount(firing.getIterationCount());
                commandsMap.put(clientThread, Integer
                        .valueOf(ClientThread.ITERATE));
            }

            int aux = levelNumber - iterationsValue;

            if (aux >= 0) {
                firings = schedule.get(aux).firingIterator();

                while (firings.hasNext()) {
                    Firing firing = (Firing) firings.next();
                    Actor actor = firing.getActor();

                    System.out.println("removing: " + actor.getFullName());
                    ClientThread clientThread = (ClientThread) actorsThreadsMap
                            .get(actor);
                    clientThread.setIterationCount(firing.getIterationCount());
                    commandsMap.remove(clientThread);
                }
            }

            levelNumber = levelNumber + 1;
View Full Code Here

Examples of ptolemy.distributed.client.ClientThread

            for (Iterator actorsIterator = actors.iterator(); actorsIterator
                    .hasNext();) {
                Object auxActor = actorsIterator.next();
                Object auxServer = serversIterator.next();
                ClientThread auxClientThread = new ClientThread(synchronizer,
                        (ServiceItem) auxServer);
                actorsThreadsMap.put(auxActor, auxClientThread);
                auxClientThread.start();
            }
        } else {
            System.out.println("Not enough servers");
        }
View Full Code Here

Examples of ptolemy.distributed.client.ClientThread

            HashMap commandsMap = new HashMap();

            while (firings.hasNext()) {
                Firing firing = (Firing) firings.next();
                Actor actor = firing.getActor();
                ClientThread clientThread = (ClientThread) actorsThreadsMap
                        .get(actor);
                clientThread.setIterationCount(firing.getIterationCount());
                commandsMap.put(clientThread, Integer
                        .valueOf(ClientThread.ITERATE));
            }

            synchronizer.setCommands(commandsMap);
View Full Code Here

Examples of ptolemy.distributed.client.ClientThread

            while (firings.hasNext()) {
                Firing firing = (Firing) firings.next();
                Actor actor = firing.getActor();

                //                System.out.println("removing: " + actor.getFullName());
                ClientThread clientThread = (ClientThread) actorsThreadsMap
                        .get(actor);
                clientThread.setIterationCount(firing.getIterationCount());
                commandsMap.remove(clientThread);
            }
        }

        synchronizer.setCommands(commandsMap);
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.