Examples of Callback


Examples of org.fusesource.hawtjni.runtime.Callback

        bar acutal = new bar();
        memmove(acutal, ptr, bar.SIZEOF);
       
        assertEquals(expected, acutal);
    
        Callback callback = new Callback(this, "instanceCallback", 1);
        callmeback(callback.getAddress());
        assertEquals(69, instanceCallbackResult);
        callback.dispose();

        long r1 = Range.Range();
        Range.dump(r1);

        long r2 = Range.Range(10,100);
        Range.dump(r2);

        Range.delete(r1);
        Range.delete(r2);


        callback = new Callback(ExampleTest.class, "staticCallback", 1);
        callmeback(callback.getAddress());
        assertEquals(69, staticCallbackResult);
        callback.dispose();
       
        // Heap memory is not GCed, we must manually free it.
        free(ptr);

        passingtheenv("Hiram", null);
View Full Code Here

Examples of org.geomajas.gwt.client.widget.attribute.AttributeProvider.CallBack

  protected void transformResponse(DSResponse response, DSRequest request, Object data) {
    super.transformResponse(response, request, data);
  }

  protected void executeFetch(final String requestId, final DSRequest dsRequest, final DSResponse dsResponse) {
    attributeProvider.getAttributes(new CallBack() {

      public void onSuccess(List<Attribute<?>> attributes) {
        // Add the values to the list:
        ListGridRecord[] list = new ListGridRecord[attributes.size()];
        for (int i = 0; i < attributes.size(); i++) {
View Full Code Here

Examples of org.geomajas.widget.searchandfilter.client.util.Callback

        public void onClick(ClickEvent event) {
          if (handler != null) {
            exportButton.setDisabled(true);
            exportButton.setIcon(PROCESSING);
            handler.execute(layer, new Callback() {

              public void execute() {
                exportButton.setDisabled(false);
                exportButton.setIcon(BTN_EXPORT);
              }
View Full Code Here

Examples of org.hibernate.jpa.event.spi.jpa.Callback

    List<Class> orderedListeners = new ArrayList<Class>();
    XClass currentClazz = beanClass;
    boolean stopListeners = false;
    boolean stopDefaultListeners = false;
    do {
      Callback callback = null;
      List<XMethod> methods = currentClazz.getDeclaredMethods();
      final int size = methods.size();
      for ( int i = 0; i < size ; i++ ) {
        final XMethod xMethod = methods.get( i );
        if ( xMethod.isAnnotationPresent( annotation ) ) {
          Method method = reflectionManager.toMethod( xMethod );
          final String methodName = method.getName();
          if ( ! callbacksMethodNames.contains( methodName ) ) {
            //overridden method, remove the superclass overridden method
            if ( callback == null ) {
              callback = new EntityCallback( method );
              Class returnType = method.getReturnType();
              Class[] args = method.getParameterTypes();
              if ( returnType != Void.TYPE || args.length != 0 ) {
                throw new RuntimeException(
                    "Callback methods annotated on the bean class must return void and take no arguments: " + annotation
                        .getName() + " - " + xMethod
                );
              }
              if (!method.isAccessible()) method.setAccessible(true);
              log.debugf("Adding %s as %s callback for entity %s",
                     methodName,
                     annotation.getSimpleName(),
                     beanClass.getName());
              callbacks.add( 0, callback ); //superclass first
              callbacksMethodNames.add( 0, methodName );
            }
            else {
              throw new PersistenceException(
                  "You can only annotate one callback method with "
                      + annotation.getName() + " in bean class: " + beanClass.getName()
              );
            }
          }
        }
      }
      if ( !stopListeners ) {
        getListeners( currentClazz, orderedListeners );
        stopListeners = currentClazz.isAnnotationPresent( ExcludeSuperclassListeners.class );
        stopDefaultListeners = currentClazz.isAnnotationPresent( ExcludeDefaultListeners.class );
      }

      do {
        currentClazz = currentClazz.getSuperclass();
      }
      while ( currentClazz != null
          && ! ( currentClazz.isAnnotationPresent( Entity.class )
          || currentClazz.isAnnotationPresent( MappedSuperclass.class ) )
          );
    }
    while ( currentClazz != null );

    //handle default listeners
    if ( ! stopDefaultListeners ) {
      List<Class> defaultListeners = (List<Class>) reflectionManager.getDefaults().get( EntityListeners.class );

      if ( defaultListeners != null ) {
        int defaultListenerSize = defaultListeners.size();
        for ( int i = defaultListenerSize - 1; i >= 0 ; i-- ) {
          orderedListeners.add( defaultListeners.get( i ) );
        }
      }
    }

    for ( Class listener : orderedListeners ) {
      Callback callback = null;
      if ( listener != null ) {
        XClass xListener = reflectionManager.toXClass( listener );
        callbacksMethodNames = new ArrayList<String>();
        List<XMethod> methods = xListener.getDeclaredMethods();
        final int size = methods.size();
View Full Code Here

Examples of org.jboss.remoting.callback.Callback

                 
                  if (trace) { log.trace("Params is " + params); }
                 
                  if (params != null && params.length > 0 && params[0] instanceof Callback)
                  {
                     Callback callback = (Callback) params[0];
                    
                     if (trace) { log.trace("It's a callback: " + callback); }
                    
                     if (callback.getParameter() instanceof ClientDelivery)
                     {                       
                        packet = (ClientDelivery)callback.getParameter();
                       
                        if (trace) { log.trace("Message delivery callback"); }
                     }
                     else if (callback.getParameter() instanceof ConnectionFactoryUpdate)
                     {
                        packet = (ConnectionFactoryUpdate)callback.getParameter();
                       
                        if (trace) { log.trace("Connection factory update callback"); }
                     }
                  }
               }
View Full Code Here

Examples of org.jitterbit.integration.client.ui.entity.UiEntityFactory.Callback

    @Override
    public void actionPerformed(ActionEvent e) {
        if (!controller.isChangeAllowed(opNode)) {
            return;
        }
        controller.getEntityFactory().createEntity(EntityType.EmailMessage, true, new Callback() {
           
            @Override
            public void postProjectInsertion(IntegrationEntity e) {
                insertEmail((EmailMessage) e);
            }
View Full Code Here

Examples of org.joshy.gfx.event.Callback

                JFrame frame = (JFrame) stage.getNativeWindow();
                device.setFullScreenWindow(frame);
            } else {
                System.err.println("Full screen not supported");
            }
            undoFullscreen = new Callback(){
                public void call(Object event) {
                    GraphicsDevice device = GraphicsEnvironment.
                            getLocalGraphicsEnvironment().
                            getDefaultScreenDevice();
                    device.setFullScreenWindow(null);
View Full Code Here

Examples of org.jruby.runtime.callback.Callback

    @JRubyMethod(name = "append_features", required = 1, frame = true, module = true)
    public static IRubyObject append_features(IRubyObject receiver, IRubyObject include, Block block) {
        if (include instanceof RubyModule) {
            ((RubyModule) include).includeModule(receiver);
            include.getSingletonClass().defineMethod("induced_from", new Callback() {

                public IRubyObject execute(IRubyObject recv, IRubyObject[] args, Block block) {
                    Arity.checkArgumentCount(recv.getRuntime(), args, 1, 1);
                   
                    return RubyPrecision.induced_from(recv, args[0], block);
View Full Code Here

Examples of org.mockito.cglib.proxy.Callback

        return mock != null && isMockitoMock(mock);
    }

    private <T> MethodInterceptorFilter getInterceptor(T mock) {
        Factory factory = (Factory) mock;
        Callback callback = factory.getCallback(0);
        if (callback instanceof MethodInterceptorFilter) {
            return (MethodInterceptorFilter) callback;
        }
        return null;
    }
View Full Code Here

Examples of org.mule.transport.xmpp.JabberSender.Callback

        assertEquals(TEST_MESSAGE, message.getBody());
    }
   
    protected void sendJabberMessageFromNewThread()
    {
        JabberSender sender = new JabberSender(new Callback()
        {
            public void doit() throws Exception
            {
                Thread.sleep(JABBER_SEND_THREAD_SLEEP_TIME);
                jabberClient.sendMessage(muleJabberUserId, TEST_MESSAGE);
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.