Examples of LinkRequest


Examples of org.dynalang.dynalink.linker.LinkRequest

    @SuppressWarnings("unused")
    private MethodHandle relink(RelinkableCallSite callSite, int relinkCount, Object... arguments) throws Exception {
        final CallSiteDescriptor callSiteDescriptor = callSite.getDescriptor();
        final boolean unstableDetectionEnabled = unstableRelinkThreshold > 0;
        final boolean callSiteUnstable = unstableDetectionEnabled && relinkCount >= unstableRelinkThreshold;
        final LinkRequest linkRequest =
                runtimeContextArgCount == 0 ? new LinkRequestImpl(callSiteDescriptor, callSiteUnstable, arguments)
                        : new RuntimeContextLinkRequestImpl(callSiteDescriptor, callSiteUnstable, arguments,
                                runtimeContextArgCount);

        // Find a suitable method handle with a guard
View Full Code Here

Examples of org.dynalang.dynalink.linker.LinkRequest

    }

    @Override
    public GuardedInvocation getGuardedInvocation(LinkRequest request, final LinkerServices linkerServices)
            throws Exception {
        final LinkRequest ncrequest = request.withoutRuntimeContext();
        // BeansLinker already checked that the name is at least 2 elements long and the first element is "dyn".
        final CallSiteDescriptor callSiteDescriptor = ncrequest.getCallSiteDescriptor();
        final String op = callSiteDescriptor.getNameToken(CallSiteDescriptor.OPERATOR);
        // Either dyn:callMethod:name(this[,args]) or dyn:callMethod(this,name[,args]).
        if("callMethod" == op) {
            return getCallPropWithThis(callSiteDescriptor, linkerServices);
        }
View Full Code Here

Examples of org.dynalang.dynalink.linker.LinkRequest

        final BeansLinker linker = new BeansLinker();
        final LinkerServices linkerServices = LinkerServicesFactory.getLinkerServices(linker);
        final Object out = System.out;
        final CallSiteDescriptor desc = CallSiteDescriptorFactory.create(MethodHandles.publicLookup(),
                "dyn:callMethod:println", MethodType.methodType(Object.class, Object.class, Object.class));
        final LinkRequest req = new LinkRequestImpl(desc, false, out, "helloWorld");
        linker.getGuardedInvocation(req, linkerServices).getInvocation().invokeWithArguments(out, "helloWorld");
    }
View Full Code Here

Examples of org.eclipse.jst.pagedesigner.actions.link.LinkRequest

    if (part instanceof TextEditPart) {
      //TODO: ?? part = (TextEditPart) part;
      viewer = (IHTMLGraphicalViewer) part.getViewer();
    }
    if (request instanceof LinkRequest) {
      LinkRequest req = (LinkRequest) request;
      String identifier = req.getIdentifier();
      DesignRange range = req.getDesignRange();
            // TODO: when part !instancof TextEditPart, viewer == null
      Command command = new MakeLinkCommand(identifier, viewer, part,
          range);
      return command;
    }
View Full Code Here

Examples of org.jnode.httpd.dto.LinkRequest

    if (!"confirm".equals(type)) {
      String addr = req.queryParams("addr");
      String host = req.queryParams("host");
      String port = req.queryParams("port");
      if (addr != null && host != null && port != null) {
        LinkRequest lr = new LinkRequest();
        try {
          FtnAddress ftn = new FtnAddress(addr);
          if (ftn.getPoint() != 0) {
            code = "POINT";
          } else {
            FtnNdlAddress ndl = NodelistScanner.getInstance()
                .isExists(ftn);
            boolean exists = (ndl != null);
            if (!exists) {
              code = "NODELIST";
            } else {
              String name = (ndl.getLine() != null) ? ndl
                  .getLine().split(",")[4].replace('_', ' ')
                  : addr;
              lr.setName(name);
              lr.setAddress(addr);
            }
          }
        } catch (NumberFormatException e) {
          code = "FTN";
        }
        if (code == null) { // next step
          try {
            Integer iport = Integer.valueOf(port);
            if ("-".equals(host) || iport == 0) {
              host = "-";
              iport = 0;
            } else {
              Socket sock = new Socket();
              sock.connect(new InetSocketAddress(host, iport),
                  10000);
              sock.close();
            }
            lr.setHost(host);
            lr.setPort(iport);
          } catch (IOException | NumberFormatException e) {
            code = "INET";
          }
        }
        if (code == null) { // next step
          synchronized (LinkRequest.class) {
            LinkRequest lr2 = ORMManager.get(LinkRequest.class)
                .getFirstAnd("address", "=", addr);
            if (lr2 == null) {
              String akey = FtnTools.generate8d();
              lr.setAkey(akey);
              ORMManager.get(LinkRequest.class).save(lr);
              writeKey(req,lr);
            } else {
              code = "EXISTS";
            }
          }
        }
      } else {
        code = "ERROR";
      }
    } else {
      String akey = req.queryParams("key");
      String id = req.queryParams("id");
      try {
        LinkRequest lr = ORMManager.get(LinkRequest.class).getById(id);
        if (lr != null && lr.getAkey().equals(akey)) { // valid
          String password = FtnTools.generate8d();
          Link link = new Link();
          link.setLinkName(lr.getName());
          link.setLinkAddress(lr.getAddress());
          link.setProtocolHost(lr.getHost());
          link.setProtocolPort(lr.getPort());
          link.setPaketPassword(password);
          link.setProtocolPassword(password);
          // check
          synchronized (Link.class) {
            Link l2 = ORMManager.get(Link.class).getFirstAnd(
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.loader.LinkRequest

                service.addBikeRentalStation(station);
                stationSet.add(station);
                BikeRentalStationVertex vertex = verticesByStation.get(station);
                if (vertex == null) {
                    vertex = new BikeRentalStationVertex(graph, station);
                    LinkRequest request = networkLinkerLibrary.connectVertexToStreets(vertex);
                    for (Edge e : request.getEdgesAdded()) {
                        graph.addTemporaryEdge(e);
                    }
                    verticesByStation.put(station, vertex);
                    new RentABikeOnEdge(vertex, vertex, station.networks);
                    if (station.allowDropoff)
View Full Code Here

Examples of org.opentripplanner.routing.edgetype.loader.LinkRequest

                bikeService.addBikePark(bikePark);
                bikeParkSet.add(bikePark);
                BikeParkVertex bikeParkVertex = verticesByPark.get(bikePark);
                if (bikeParkVertex == null) {
                    bikeParkVertex = new BikeParkVertex(graph, bikePark);
                    LinkRequest request = networkLinkerLibrary
                            .connectVertexToStreets(bikeParkVertex);
                    for (Edge e : request.getEdgesAdded()) {
                        graph.addTemporaryEdge(e);
                    }
                    verticesByPark.put(bikePark, bikeParkVertex);
                    new BikeParkEdge(bikeParkVertex);
                } else {
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.