Examples of Delegate


Examples of com.google.apphosting.api.ApiProxy.Delegate

        // test@example.com というユーザがログイン中、という状態を作っておく。
        TestEnvironment environment =
            (TestEnvironment) ApiProxy.getCurrentEnvironment();
        environment.setEmail("test@example.com");
        // メール送信API をフックするApiProxy.Delegate を適用しておく。
        @SuppressWarnings("rawtypes")
        Delegate parentDelegate = ApiProxy.getDelegate();
        MailDelegate mailDelegate = new MailDelegate();
        ApiProxy.setDelegate(mailDelegate);
        tester.request.setMethod("POST");
        tester.param("title", " テスト用議事録1");
View Full Code Here

Examples of com.google.gwt.user.client.ui.ResizeLayoutPanel.Impl.Delegate

  };
  private boolean resizeCmdScheduled = false;

  public ResizeLayoutPanel() {
    layout = new Layout(getElement());
    impl.init(getElement(), new Delegate() {
      public void onResize() {
        scheduleResize();
      }
    });
  }
View Full Code Here

Examples of com.sun.enterprise.management.support.Delegate

                final Set<ObjectName> names = JMXUtil.queryNames( remoteConn, onPattern, null);

                assert( names.size() == 1 );

                final ObjectName serverON = GSetUtil.getSingleton( names );
                final Delegate  delegate = new DelegateToMBeanDelegate( remoteConn, serverON );
               
                setDelegate( delegate );
                setstartTime(System.currentTimeMillis());
//System.out.println( "########## DASJ2EEServerImpl.setDelegate(): set delegate to " + serverON);
        }
View Full Code Here

Examples of mockit.Delegate

    public void testStart() throws Exception {
        final Namespace parent = Namespace.createFromString("net.tralfamadore");

        new NonStrictExpectations() {
            {
                pageContent.getNamespace(); result = new Delegate() {
                    Namespace returnANamespace() {
                        return parent;
                    }
                };
                pageContent.getNamespaceToAdd(); result = Namespace.createFromString("net.tralfamadore.site");
View Full Code Here

Examples of net.emaze.dysfunctional.dispatching.delegates.Delegate

    }
   

    @Test(expected = ClassCastException.class)
    public void passingWrongTypeToErasureYieldsException() {
        Delegate c = new Reductor<Long, Integer>(new Count<Integer>(), 0l);
        c.perform(new Object());
    }   
View Full Code Here

Examples of one.nio.serial.gen.Delegate

    public void testDefaultFields() throws Exception {
        List<Field> defaultFields = Arrays.asList(DefaultFieldsTest.class.getDeclaredFields());
        byte[] code = DelegateGenerator.generate(DefaultFieldsTest.class, new FieldDescriptor[0], defaultFields);

        Delegate delegate = StubGenerator.INSTANCE.instantiate(code, Delegate.class);
        DefaultFieldsTest obj = (DefaultFieldsTest) delegate.read(new DataStream(0));

        assertEquals("abc", obj.s);
        assertEquals(0x100, obj.i);
        assertEquals(Long.valueOf(-999999), obj.l);
        assertEquals(true, obj.getClass().getDeclaredField("b").getBoolean(obj));
View Full Code Here

Examples of org.apache.uima.aae.delegate.Delegate

   *          - the destination where the delegate receives messages
   *
   * @throws AsynchAEException
   */
  public void sendRequest(int aCommand, Endpoint anEndpoint) {
    Delegate delegate = null;
    try {
      JmsEndpointConnection_impl endpointConnection = getEndpointConnection(anEndpoint);

      TextMessage tm = endpointConnection.produceTextMessage("");
      tm.setIntProperty(AsynchAEMessage.Payload, AsynchAEMessage.None);
      tm.setText(""); // Need this to prevent the Broker from throwing an exception when sending a
      // message to C++ service

      populateHeaderWithRequestContext(tm, anEndpoint, aCommand);

      // For remotes add a special property to the message. This property
      // will be echoed back by the service. This property enables matching
      // the reply with the right endpoint object managed by the aggregate.
      if (anEndpoint.isRemote()) {
        tm.setStringProperty(AsynchAEMessage.EndpointServer, anEndpoint.getServerURI());
      }
      boolean startTimer = false;
      // Start timer for endpoints that are remote and are managed by a different broker
      // than this service. If an endpoint contains a destination object, the outgoing
      // request will contain a JMSReplyTo object which will point to a temp queue
      if (anEndpoint.isRemote() && anEndpoint.getDestination() == null) {
        startTimer = true;
      }
      if (aCommand == AsynchAEMessage.CollectionProcessComplete) {
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINE)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(Level.FINE, CLASS_NAME.getName(),
                  "sendRequest", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAEE_send_cpc_req__FINE", new Object[] { anEndpoint.getEndpoint() });
        }
      } else if (aCommand == AsynchAEMessage.ReleaseCAS) {
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINEST)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(
                  Level.FINEST,
                  CLASS_NAME.getName(),
                  "sendRequest",
                  JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_releasecas_request__endpoint__FINEST",
                  new Object[] { getAnalysisEngineController().getName(),
                      endpointConnection.getEndpoint() });
        }
      } else if (aCommand == AsynchAEMessage.GetMeta) {
        if (anEndpoint.getDestination() != null) {
          String replyQueueName = ((ActiveMQDestination) anEndpoint.getDestination())
                  .getPhysicalName().replaceAll(":", "_");
          if (getAnalysisEngineController() instanceof AggregateAnalysisEngineController) {
            String delegateKey = ((AggregateAnalysisEngineController) getAnalysisEngineController())
                    .lookUpDelegateKey(anEndpoint.getEndpoint());
            ServiceInfo serviceInfo = ((AggregateAnalysisEngineController) getAnalysisEngineController())
                    .getDelegateServiceInfo(delegateKey);
            if (serviceInfo != null) {
              serviceInfo.setReplyQueueName(replyQueueName);
              serviceInfo.setServiceKey(delegateKey);
            }
            delegate = lookupDelegate(delegateKey);
            if (delegate.getGetMetaTimeout() > 0) {
              delegate.startGetMetaRequestTimer();
            }
          }
        } else if (!anEndpoint.isRemote()) {
          ServiceInfo serviceInfo = ((AggregateAnalysisEngineController) getAnalysisEngineController())
                  .getServiceInfo();
          if (serviceInfo != null) {
            serviceInfo.setReplyQueueName(controllerInputEndpoint);
          }
        }
      } else {
        if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.FINEST)) {
          UIMAFramework.getLogger(CLASS_NAME).logrb(
                  Level.FINEST,
                  CLASS_NAME.getName(),
                  "sendRequest",
                  JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
                  "UIMAJMS_metadata_request__endpoint__FINEST",
                  new Object[] { endpointConnection.getEndpoint(),
                      endpointConnection.getServerUri() });
        }
      }
      if (endpointConnection.send(tm, 0, startTimer) != true) {
        throw new ServiceNotFoundException();
      }

    } catch (Exception e) {
      if (delegate != null && aCommand == AsynchAEMessage.GetMeta) {
        delegate.cancelDelegateTimer();
      }
      // Handle the error
      ErrorContext errorContext = new ErrorContext();
      errorContext.add(AsynchAEMessage.Command, aCommand);
      errorContext.add(AsynchAEMessage.Endpoint, anEndpoint);
View Full Code Here

Examples of org.apache.uima.aae.delegate.Delegate

    // the service is configured to use time to live (TTL), add
    // JMS message expiration time. The TTL is by default always
    // added to the message. To override this add "-DNoTTL" to the
    // command line.
    if (timeout > 0 && addTimeToLive) {
      Delegate delegate = lookupDelegate(anEndpoint.getDelegateKey());
      long ttl = timeout;
      // How many CASes are in the list of CASes pending reply for this delegate
      int currentOutstandingCasListSize = delegate.getCasPendingReplyListSize();
      if (currentOutstandingCasListSize > 0) {
        // increase the time-to-live
        ttl *= currentOutstandingCasListSize;
      }
      aMessage.setJMSExpiration(ttl);
View Full Code Here

Examples of org.apache.uima.aae.delegate.Delegate

  }

  private Delegate lookupDelegate(String aDelegateKey) {
    if (getAnalysisEngineController() instanceof AggregateAnalysisEngineController) {
      Delegate delegate = ((AggregateAnalysisEngineController) getAnalysisEngineController())
              .lookupDelegate(aDelegateKey);
      return delegate;
    }
    return null;
  }
View Full Code Here

Examples of org.apache.uima.aae.delegate.Delegate

    }
    return null;
  }

  private void addCasToOutstandingList(CacheEntry entry, boolean isRequest, String aDelegateKey) {
    Delegate delegate = null;
    if (isRequest && (delegate = lookupDelegate(aDelegateKey)) != null) {
      delegate.addCasToOutstandingList(entry.getCasReferenceId());
    }
  }
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.