Package com.peterhi.net2

Examples of com.peterhi.net2.Endpoint$Frame


    private void addClusterNodes(final EJBClientContext ejbClientContext, final String clusterName, final Map<String, List<ClientMapping>> addedNodes) {
        if (addedNodes == null || addedNodes.isEmpty()) {
            return;
        }
        final EJBRemoteConnectorService ejbRemoteConnectorService = this.ejbRemoteConnectorServiceValue.getOptionalValue();
        final Endpoint endpoint = this.endpointValue.getOptionalValue();
        if(ejbRemoteConnectorService == null || endpoint == null) {
            return;
        }
        final SocketBinding ejbRemoteConnectorSocketBinding = ejbRemoteConnectorService.getEJBRemoteConnectorSocketBinding();
        final InetAddress bindAddress = ejbRemoteConnectorSocketBinding.getAddress();
View Full Code Here



            @Override
            public void run() {
                try {
                    final Endpoint endpoint = Remoting.createEndpoint("endpoint", OptionMap.EMPTY);
                    endpoint.addConnectionProvider("remote", new RemoteConnectionProviderFactory(), OptionMap.create(Options.SSL_ENABLED, Boolean.FALSE));

                    // open a connection
                    final IoFuture<Connection> futureConnection = endpoint.connect(new URI(hostUrl), OptionMap.create(Options.SASL_POLICY_NOANONYMOUS, Boolean.FALSE), new AnonymousCallbackHandler());
                    final Connection connection = IoFutureHelper.get(futureConnection, 5L, TimeUnit.SECONDS);
                    try {
                        try {

                            final ClassLoader oldTccl = SecurityActions.getContextClassLoader();
                            try {
                                try {
                                    SecurityActions.setContextClassLoader(classLoader);

                                    final EJBClientContext ejbClientContext = EJBClientContext.create();
                                    ejbClientContext.registerConnection(connection);
                                    final ContextSelector<EJBClientContext> previousSelector = EJBClientContext.setConstantContext(ejbClientContext);
                                    applicationClientDeploymentServiceInjectedValue.getValue().getDeploymentCompleteLatch().await();

                                    try {
                                        NamespaceContextSelector.pushCurrentSelector(namespaceContextSelectorInjectedValue);
                                        //do static injection etc
                                        //TODO: this should be better
                                        instance = applicationClientComponent.getValue().createInstance();
                                        mainMethod.invoke(null, new Object[]{parameters});
                                    } finally {
                                        if (previousSelector != null) {
                                            EJBClientContext.setSelector(previousSelector);
                                        }
                                        NamespaceContextSelector.popCurrentSelector();
                                    }
                                }  catch (Exception e) {
                                    ROOT_LOGGER.exceptionRunningAppClient(e, e.getClass().getSimpleName());
                                } finally {
                                    SecurityActions.setContextClassLoader(oldTccl);
                                }
                            } finally {
                                CurrentServiceContainer.getServiceContainer().shutdown();
                            }
                        } finally {
                            connection.close();
                        }
                    } finally {
                        endpoint.close();
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
                } catch (URISyntaxException e) {
                    throw new RuntimeException(e);
View Full Code Here

        this.destination = destination;
    }

    @Override
    public IoFuture<Connection> connect() throws IOException {
        final Endpoint endpoint = this.endpointInjectedValue.getValue();
        return endpoint.connect(this.destination, this.connectionCreationOptions, getCallbackHandler());
    }
View Full Code Here

        safeClose(endpoint);
    }

    /** {@inheritDoc} */
    public synchronized Endpoint getValue() throws IllegalStateException {
        final Endpoint endpoint = this.endpoint;
        if (endpoint == null) throw new IllegalStateException();
        return endpoint;
    }
View Full Code Here

   {
      URL wsdlURL = new URL(endpointURL + "?wsdl");
      QName serviceName = new QName(targetNS, "EndpointService");

      Service service = Service.create(wsdlURL, serviceName);
      Endpoint port = (Endpoint)service.getPort(Endpoint.class);

      Object retObj = port.echo("Hello");
      assertEquals("Hello", retObj);
   }
View Full Code Here

   {
      URL wsdlURL = new URL(endpointURL + "?wsdl");
      QName serviceName = new QName(targetNS, "EndpointService");

      Service service = Service.create(wsdlURL, serviceName);
      Endpoint port = (Endpoint)service.getPort(Endpoint.class);

      Object retObj = port.echo("Hello");
      assertEquals("Hello", retObj);
   }
View Full Code Here

      Animation animation) {
    d.printSection(animation.getName());
    d.printKeyValue("DefaultKeyDuration",""+animation.getDefaultKeyDuration());
    Frame[] frames = animation.getFrames();
    for(int fi=0; fi<frames.length; fi++) {
      Frame f = frames[fi];
      d.printKeyValue("KeyData"+(fi+1),f.getName());
      if(f.getKeyDuration()>0)
        d.printKeyValue("KeyDuration"+(fi+1),""+f.getKeyDuration());
    }
    for(int fi=0; fi<frames.length; fi++) {
      Frame f = frames[fi];
      Point offset = f.getOffset();
      if(offset.x!=0 || offset.y!=0) {
        d.printKeyValue("KeyEventName"+(fi+1),"__"+fi);
        d.printKeyValue("__"+fi, "("+offset.x+","+offset.y+",0)");       
      }
    }
View Full Code Here

    return null;
  }

  @Override
  public long getFrameDelay(int index) {
    Frame frame = getFrame(index);
    return (long) (frame.getFinalFrameDuration()*1000);
  }
 
View Full Code Here

        for(Frame frame: animation.getFrames()) {
          paintFrame(g, frame);
        }
      }
      if (selected instanceof Frame) {
        Frame frame = (Frame) selected;
        paintFrame(g,frame);
      }   
    }
    if(freeOffsetStart != null && freeOffsetEnd != null) {
      Point base = toScreen(freeOffsetStart);
View Full Code Here

  private int snap(int snapMe){
    return java.lang.Math.round( snapMe/parent.SnapSlider.getValue() )*parent.SnapSlider.getValue();
  }
 
  @Override public void mouseDragged(MouseEvent e) {
    Frame selected = getSelectedFrame();
    if(selected==null) return;
    if((e.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) == MouseEvent.BUTTON3_DOWN_MASK) {
      if(parent.isSettingOffsetDirectly())
        handleEditOffset(selected,e);     
      if(parent.isSettingOffsetWithRelativePos())
        freeOffsetEnd = getViewPoint(e);
      if(parent.isSettingPivot()) 
        selected.setPivot(new Point(getViewX(e),getViewY(e)));
      if(parent.isRectangleLocked()) {
        int x = snap(getViewX(e)), y = snap(getViewY(e))

        selected.setRectangle(new Rectangle(x,y,parent.lockRectButton.lastRect.width,parent.lockRectButton.lastRect.height));
        selected.setImageFile(editorFrame.getData().getProject().getRelativeFile(imageFile));

        int PivotDX = parent.lockRectButton.lastPivot.x - parent.lockRectButton.lastRect.x;
        int PivotDY = parent.lockRectButton.lastPivot.y - parent.lockRectButton.lastRect.y;
        selected.setPivot(new Point(x+PivotDX,y+PivotDY));
      }
      if(parent.isEditingRectangle()){
       
        Rectangle rect = selected.getRectangle();
        int x = snap(rect.x), y = snap(rect.y);
        int dx = snap(getViewX(e)-x), dy = snap(getViewY(e)-y);
        Rectangle newRectangle = new Rectangle(x,y,dx,dy);
        selected.setRectangle(newRectangle);
        selected.setImageFile(editorFrame.getData().getProject().getRelativeFile(imageFile));
      }
      if(parent.isSettingOffsetWithTemporaryPivot()) {
        if(parent.temporaryPivotOffsetButton.getPivot2()!=null) {
          parent.temporaryPivotOffsetButton.setPivot2(getViewPoint(e));
          selected.setOffset(parent.temporaryPivotOffsetButton.getOffset());
        }
        else
          parent.temporaryPivotOffsetButton.setPivot1(getViewPoint(e));
      }
    }
View Full Code Here

TOP

Related Classes of com.peterhi.net2.Endpoint$Frame

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.