Package juzu.impl.router

Examples of juzu.impl.router.Route$Data


     *
     * @return Contentinfo with contentType Data.
     */
    private ContentInfo makeData(SafeContents safe) throws IOException,
      ASN1Exception {
  Data data = null;
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  DEREncoder encoder = new DEREncoder(baos);
  safe.encode(encoder);
  data = new Data(baos.toByteArray());
  baos.close();
  ContentInfo cInfo = new ContentInfo(data);
  return cInfo;
    }
View Full Code Here


  // check version before any other operations
  Request request = new Request (display, major_opcode, 0, 3);
  request.write4 (CLIENT_MAJOR_VERSION);
  request.write4 (CLIENT_MINOR_VERSION);

  Data reply = display.read_reply (request);
  server_major_version = reply.read4 (8);
  server_minor_version = reply.read4 (12);
    }
View Full Code Here

     */
    public long getOverlayWindow (Window win) {
  Request request = new Request (display, major_opcode, 7, 2);
  request.write4 (win.id);

  Data reply = display.read_reply (request);
  if (reply == null) {
      return -1;
  }

  return reply.read4(8);
    }
View Full Code Here

    // check version before any other operations
    Request request = new Request (display, major_opcode, 0, 3);
    request.write4 (CLIENT_MAJOR_VERSION);
    request.write4 (CLIENT_MINOR_VERSION);
 
    Data reply = display.read_reply (request);
    server_major_version = reply.read2 (8);
    server_minor_version = reply.read2 (10);
  }
View Full Code Here

    //
    HashMap<MethodHandle, Route> forwardRoutes = new HashMap<MethodHandle, Route>();
    HashMap<Route, RouteDescriptor> backwardRoutes = new HashMap<Route, RouteDescriptor>();

    //
    Route root = new Router();
    RouterService router = bridge.getApplication().resolveBean(RouterService.class);
    if (router != null) {
      RouterDescriptor desc = router.getDescriptor();
      if (desc != null) {
        Map<RouteDescriptor, Route> ret = desc.popupate(root);
View Full Code Here

    // No method -> not found
    if (requestTarget == null) {
      bridge.getRequestContext().setStatus(404);
    } else {
      if (requestMatch == null) {
        Route requestRoute = getRoute(requestTarget.getHandle());
        if (requestRoute != null) {
          requestMatch = requestRoute.matches(Collections.<String, String>emptyMap());
          if (requestMatch != null) {
            StringBuilder sb = new StringBuilder();
            requestMatch.render(new UriBuilder(sb));
            if (!sb.toString().equals(requestPath)) {
              StringBuilder redirect = new StringBuilder();
View Full Code Here

  }

  public Map<RouteDescriptor, Route> popupate(Route parent) {
    Map<RouteDescriptor, Route> ret = new LinkedHashMap<RouteDescriptor, Route>();
    for (RouteDescriptor routeDescriptor : routes) {
      Route route = routeDescriptor.popupate(parent);
      ret.put(routeDescriptor, route);
    }
    return ret;
  }
View Full Code Here

  public final DispatchBridge createDispatch(Phase phase, final MethodHandle target, final Map<String, ResponseParameter> parameters) {
    ControllerHandler handler = bridge.getApplication().resolveBean(ControllerService.class).getDescriptor().getMethodByHandle(target);

    //
    Route route = this.handler.getRoute(handler.getHandle());
    if (route == null) {
      if (bridge.getApplication().resolveBean(ControllerService.class).getResolver().isIndex(handler)) {
        route = this.handler.getRoot();
      }
    }

    //
    if (route != null) {
      Map<String, String> params;
      if (parameters.isEmpty()) {
        params = Collections.emptyMap();
      } else {
        params = new HashMap<String, String>(parameters.size());
        for (ResponseParameter parameter : parameters.values()) {
          params.put(parameter.getName(), parameter.get(0));
        }
      }

      //
      final RouteMatch match = route.matches(params);
      if (match != null) {
        return new DispatchBridge() {

          public MethodHandle getTarget() {
            return target;
View Full Code Here

      Configuration configuration = project.getConfiguration();

      if (configuration != null)
      {
        Data data = configuration.getData();

        if (data != null)
        {
          ModuleDependencies moduleDependencies = data.getModuleDependencies();

          if (moduleDependencies != null)
          {
            dependencies = moduleDependencies.getDependency();
          }
View Full Code Here

TOP

Related Classes of juzu.impl.router.Route$Data

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.