Package org.restlet

Examples of org.restlet.Context


    }

    @Override
    protected void doInit() throws ResourceException {
        super.doInit();
        Context ctx = getContext();
        ConcurrentMap<String, Object> attribs = ctx.getAttributes();
        clients = ClientStoreFactory.getInstance();

        // NOT NEEDED I THINK:
        /*
         * clients = (ClientStore<?>) attribs.get(ClientStore.class
View Full Code Here


                                    public InputStream getInputStream()
                                            throws IOException {
                                        InputStream result = null;

                                        // Retrieve the current context
                                        final Context context = Context
                                                .getCurrent();

                                        if (context != null) {
                                            final Response response = context
                                                    .getClientDispatcher()
                                                    .handle(new Request(
                                                            Method.GET,
                                                            this.url.toString()));
View Full Code Here

                  getLogger().info(t.getURI()+": "+t.getFirstValue());
               }
               getLogger().info(T_APP_MATCH.toString());
               Term classTerm = entry.getTerm(T_APP_CLASS);
               Term proxyTerm = entry.getTerm(T_APP_PROXY);
               Context appContext = context.createChildContext();
               LinkSet set = new LinkSet();
               set.addLinkSet(entry.getLinks());
               set.addLinkSet(hostConf.getLinks());
               appContext.getAttributes().put(WebComponent.LINKS_ATTR,set);
               appContext.getAttributes().put(ScriptManager.ATTR,scriptManager);
               appContext.getAttributes().put(ResourceManager.ATTR,resourceManager);
               for (URI t : entry.getTerms().keySet()) {
                  String value = entry.getTerm(t).getFirstValue();
                  getLogger().info("Setting parameter: "+t+"="+value);
                  appContext.getParameters().set(t.toString(),value,false);
               }
               appContext.getParameters().set("username",autoConf.getUsername(),false);
               appContext.getParameters().set("password",autoConf.getPassword(),false);
               for (Term t : entry.getTerms().values()) {
                  String key = t.getURI().toString();
                  if (t.getValues()!=null) {
                     for (String value : t.getValues()) {
                        appContext.getParameters().add(key, value);
                     }
                  } else {
                     appContext.getParameters().add(key,"true");
                  }
               }
               Application app = null;
               if (proxyTerm!=null) {
                  String value = proxyTerm.getFirstValue();
View Full Code Here

        this.clientResource.setCommandSequence("314159");
        this.clientResource.setFrom(new Address("sip:alice@atlanta.com",
                "Alice"));
        this.clientResource.setTo(new Address("sip:bob@biloxi.com", "Bob"));

        Client client = new Client(new Context(), Protocol.SIP);
        client.getContext().getParameters().add("minThreads", "1");
        client.getContext().getParameters().add("tracing", "true");
        client.getContext().getParameters().add("proxyHost", "localhost");
        client.getContext().getParameters().add("proxyPort", "5060");
        this.clientResource.setNext(client);
View Full Code Here

    public static void main(String[] args) throws Exception {
        Engine.setLogLevel(Level.FINE);
        Server server = null;

        if (args.length == 1) {
            server = new Server(new Context(), Protocol.SIP,
                    Integer.parseInt(args[0]), UacServerResource.class);
        } else {
            server = new Server(new Context(), Protocol.SIP,
                    UacServerResource.class);
        }

        ClassLoader cl = UacServerResource.class.getClassLoader();
        InputStream is = cl.getResourceAsStream("UacServerResource.properties");
View Full Code Here

    /**
     * @param args
     * @throws Exception
     */
    public static void main(String[] args) throws Exception {
        Client sdcClient = new Client(new Context(), Protocol.valueOf("SDC"));
        Series<Parameter> parameters = sdcClient.getContext().getParameters();
        parameters.add("keystorePath", "sdc.keystore");
        parameters.add("keystorePassword", "password");
        parameters.add("enabledCipherSuites", "TLS_RSA_WITH_AES_128_CBC_SHA");
        parameters.add("sslProtocol", "TLSv1");
View Full Code Here

                           getLogger().warning("Ignoring duplicate host for " + host.getName() + " from auto-configuration.");
                           return;
                        }
                     }

                     Context hostContext = getContext().createChildContext();
                    
                     ConfiguredHost confHost = new ConfiguredHost(hostContext, getInternalRouter(),serverConf, host, edited, false);

                     // The auto host should not be in confHosts as it isn't static
                     //confHosts.put(host.getName(), confHost);
View Full Code Here

     *
     * @param protocol
     *            The server's protocol such as "HTTP" or "HTTPS".
     */
    public SpringServer(String protocol) {
        super(new Context(), Protocol.valueOf(protocol), (Restlet) null);
    }
View Full Code Here

     *            The server's protocol such as "HTTP" or "HTTPS".
     * @param port
     *            The port number.
     */
    public SpringServer(String protocol, int port) {
        super(new Context(), Protocol.valueOf(protocol), port, (Restlet) null);
    }
View Full Code Here

     *            The IP address.
     * @param port
     *            The port number.
     */
    public SpringServer(String protocol, String address, int port) {
        super(new Context(), Protocol.valueOf(protocol), address, port, null);
    }
View Full Code Here

TOP

Related Classes of org.restlet.Context

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.