Package thread.concurrencyCookbook.chapter3.recipe3

Examples of thread.concurrencyCookbook.chapter3.recipe3.Participant


   * @param args
   */
  public static void main(String[] args) {

    // Launch the prime numbers generator
    Thread task=new PrimeGenerator();
    task.start();
   
    // Wait 5 seconds
    try {
      TimeUnit.SECONDS.sleep(5);
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
   
    // Interrupt the prime number generator
    task.interrupt();
  }
View Full Code Here


    PrintQueue printQueue=new PrintQueue();
   
    // Creates ten Threads
    Thread thread[]=new Thread[10];
    for (int i=0; i<10; i++){
      thread[i]=new Thread(new Job(printQueue),"Thread "+i);
    }
   
    // Starts the Threads
    for (int i=0; i<10; i++){
      thread[i].start();
View Full Code Here

   * send documents to the print queue at the same time.
   */
  public static void main (String args[]){
   
    // Creates the print queue
    PrintQueue printQueue=new PrintQueue();
   
    // Creates ten Threads
    Thread thread[]=new Thread[10];
    for (int i=0; i<10; i++){
      thread[i]=new Thread(new Job(printQueue),"Thread "+i);
View Full Code Here

    Thread threadConference=new Thread(conference);
    threadConference.start();
   
    // Creates ten participants, a thread for each one and starts them
    for (int i=0; i<10; i++){
      Participant p=new Participant(conference, "Participant "+i);
      Thread t=new Thread(p);
      t.start();
    }

  }
View Full Code Here

   * @param args
   */
  public static void main(String[] args) {

    // Creates a VideoConference with 10 participants.
    Videoconference conference=new Videoconference(10);
    // Creates a thread to run the VideoConference and start it.
    Thread threadConference=new Thread(conference);
    threadConference.start();
   
    // Creates ten participants, a thread for each one and starts them
View Full Code Here

    // Create a random number generator
    Random random=new Random();
    // Create and send to the executor the ten tasks
    for (int i=0; i<10; i++){
      Integer number=new Integer(random.nextInt(10));
      FactorialCalculator calculator=new FactorialCalculator(number);
      Future<Integer> result=executor.submit(calculator);
      resultList.add(result);
    }
   
    // Wait for the finalization of the ten tasks
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.PARTICIPANT: {
            Participant participant = (Participant) theEObject;
            T result = caseParticipant(participant);
            if (result == null)
                result = caseBaseElement(participant);
            if (result == null)
                result = caseInteractionNode(participant);
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setInnerParticipantRef(Participant newInnerParticipantRef) {
        Participant oldInnerParticipantRef = innerParticipantRef;
        innerParticipantRef = newInnerParticipantRef;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET,
                    Bpmn2Package.PARTICIPANT_ASSOCIATION__INNER_PARTICIPANT_REF,
                    oldInnerParticipantRef, innerParticipantRef));
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setOuterParticipantRef(Participant newOuterParticipantRef) {
        Participant oldOuterParticipantRef = outerParticipantRef;
        outerParticipantRef = newOuterParticipantRef;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET,
                    Bpmn2Package.PARTICIPANT_ASSOCIATION__OUTER_PARTICIPANT_REF,
                    oldOuterParticipantRef, outerParticipantRef));
View Full Code Here

     * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
     * @generated
     */
    public void setInitiatingParticipantRef(Participant newInitiatingParticipantRef) {
        Participant oldInitiatingParticipantRef = initiatingParticipantRef;
        initiatingParticipantRef = newInitiatingParticipantRef;
        if (eNotificationRequired())
            eNotify(new ENotificationImpl(this, Notification.SET,
                    Bpmn2Package.GLOBAL_CHOREOGRAPHY_TASK__INITIATING_PARTICIPANT_REF,
                    oldInitiatingParticipantRef, initiatingParticipantRef));
View Full Code Here

TOP

Related Classes of thread.concurrencyCookbook.chapter3.recipe3.Participant

Copyright © 2018 www.massapicom. 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.