Package com.betfair.cougar.core.api.ev

Examples of com.betfair.cougar.core.api.ev.ExecutionObserver


    }

    public void notifyObservers(int state) {
        synchronized (executionObservers) {
            for (WeakReference<ExecutionObserver> ref : executionObservers) {
                ExecutionObserver obs = ref.get();
                if (obs != null) {
                    obs.onResult(new ExecutionResult(new CougarServiceException(ServerFaultCode.JMSTransportCommunicationFailure, "Connection to Sonic has been lost")));
                }
            }
            executionObservers = new HashSet<WeakReference<ExecutionObserver>>();
        }
    }
View Full Code Here


    private void cleanupObserverList() {
        List<WeakReference> deadList = new ArrayList<WeakReference>();
        synchronized (executionObservers) {
            for (WeakReference<ExecutionObserver> ref : executionObservers) {
                ExecutionObserver obs = ref.get();
                if (obs == null) {
                    deadList.add(ref);
                }
            }
            executionObservers.removeAll(deadList);
View Full Code Here

    private void subscribe() {
        BaseExecutionContext ctx = new BaseExecutionContext();

        client.subscribeToTimeTick(ctx, new Object[0],
            new ExecutionObserver() {
                @Override
                public void onResult(ExecutionResult result) {
                    switch (result.getResultType()) {
                        case Subscription:
                            timeTickSubscription = result.getSubscription();
                            break;
                        case Success:
                            TimeTick timeTick = (TimeTick)result.getResult();
                            System.out.println("Time service tick: " + timeTick.getTime());
                            break;
                        case Fault:
                            System.out.println(result.getFault());
                            break;
                    }
                }
        });

        client.subscribeToMatchedBet(ctx, new Object[0], new ExecutionObserver() {

            @Override
            public void onResult(ExecutionResult result) {
                switch (result.getResultType()) {
                    case Subscription:
View Full Code Here

   
   
    ExecutionVenue ev = createExecutionVenue(testComplexMutatorKey,parameters, SimpleResponse.class);
    System.out.print("Starting additional parameter test : ");
    final CountDownLatch cl = new CountDownLatch(1);
    e.execute(ec, testComplexMutatorKey, new Object[] {o,o}, new ExecutionObserver() {

      @Override
      public void onResult(ExecutionResult executionResult) {
        if (!executionResult.isFault()) {
          SimpleResponse response = (SimpleResponse) executionResult.getResult();
View Full Code Here

    ExecutionVenue ev = createExecutionVenue(testComplexMutatorKey,parameters, SimpleResponse.class);
   
    System.out.print("Starting testAdditionalField : ");

    final CountDownLatch cl = new CountDownLatch(1);
    e.execute(ec, testComplexMutatorKey, new Object[] {o,o}, new ExecutionObserver() {

      @Override
      public void onResult(ExecutionResult executionResult) {
        if (!executionResult.isFault()) {
          SimpleResponse response = (SimpleResponse) executionResult.getResult();
View Full Code Here

    ExecutionVenue ev = createExecutionVenue(testComplexMutatorKey,parameters, SimpleResponse.class);
   
    System.out.print("Starting testOptionalFieldNotPresent : ");

    final CountDownLatch cl = new CountDownLatch(1);
    e.execute(ec, testComplexMutatorKey, new Object[] {o,o}, new ExecutionObserver() {

      @Override
      public void onResult(ExecutionResult executionResult) {
        if (!executionResult.isFault()) {
          SimpleResponse response = (SimpleResponse) executionResult.getResult();
View Full Code Here

    ExecutionVenue ev = createExecutionVenue(testComplexMutatorKey,parameters, SimpleResponse.class);
   
    System.out.print("Starting testMandatoryFieldNotPresent : ");

    final CountDownLatch cl = new CountDownLatch(1);
    e.execute(ec, testComplexMutatorKey, new Object[] {o,o}, new ExecutionObserver() {

      @Override
      public void onResult(ExecutionResult executionResult) {
        if (!executionResult.isFault()) {
          System.out.println("FAIL");
View Full Code Here

    ExecutionVenue ev = createExecutionVenue(enumOperationKey,parameters, EnumOperationResponseObject.class);

    BodyParamEnumObject bodyObject = new BodyParamEnumObject(body);
    final CountDownLatch cl = new CountDownLatch(1);
    System.out.print("Starting testServerAddedValues : ");
    e.execute(ec, enumOperationKey, new Object[] {header,query,bodyObject}, new ExecutionObserver() {

      @Override
      public void onResult(ExecutionResult executionResult) {
        if (executionResult.isFault()) {
          System.out.println("FAIL");
View Full Code Here

    ExecutionVenue ev = createExecutionVenue(enumOperationKey,parameters,EnumOperationResponseObject.class);

    BodyParamEnumObject bodyObject = new BodyParamEnumObject(body);
    final CountDownLatch cl = new CountDownLatch(1);
    System.out.print("Starting testServerRemovedValues : ");
    e.execute(ec, enumOperationKey, new Object[] {header,query,bodyObject}, new ExecutionObserver() {

      @Override
      public void onResult(ExecutionResult executionResult) {
        if (executionResult.isFault()) {
          System.out.println("PASS");
View Full Code Here

    ExecutionVenue ev = createExecutionVenue(enumOperationKey,parameters, EnumOperationResponseObject.class);

    BodyParamEnumObject bodyObject = new BodyParamEnumObject(body);
    final CountDownLatch cl = new CountDownLatch(1);
    System.out.print("Starting testServerRemovedValues : ");
    e.execute(ec, enumOperationKey, new Object[] {header,query,bodyObject}, new ExecutionObserver() {

      @Override
      public void onResult(ExecutionResult executionResult) {
        if (executionResult.isFault()) {
          System.out.println("PASS");
View Full Code Here

TOP

Related Classes of com.betfair.cougar.core.api.ev.ExecutionObserver

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.