Examples of Context


Examples of org.apache.openjpa.kernel.exps.Context

    /**
     * Populate a kernel expression tree by translating the components of this
     * receiver with the help of the given {@link ExpressionFactory}.
     */
    QueryExpressions getQueryExpressions(ExpressionFactory factory) {
        Context context = new Context(null, null, null);
        _contexts.get().push(context);
        try {
            return new CriteriaExpressionBuilder().getQueryExpressions(factory, this);
        }finally{
            _contexts.remove();
View Full Code Here

Examples of org.apache.poi.xslf.model.geom.Context

                    0,
                    w,
                    h
            );

            Context ctx = new Context(geom, pathAnchor, new IAdjustableShape() {

                public Guide getAdjustValue(String name) {
                    CTPresetGeometry2D prst = _shape.getSpPr().getPrstGeom();
                    if (prst.isSetAvLst()) {
                        for (CTGeomGuide g : prst.getAvLst().getGdList()) {
View Full Code Here

Examples of org.apache.servicemix.soap.Context

        }

        PostMethod method = new PostMethod(getRelUri(locationURI));
        SoapMessage soapMessage = new SoapMessage();
        soapHelper.getJBIMarshaler().fromNMS(soapMessage, nm);
        Context context = soapHelper.createContext(soapMessage);
        soapHelper.onSend(context);
        SoapWriter writer = soapHelper.getSoapMarshaler().createWriter(soapMessage);
        copyHeaderInformation(nm, method);
        RequestEntity entity = writeMessage(writer);
        // remove content-type header that may have been part of the in message
        if (!endpoint.isWantContentTypeHeaderFromExchangeIntoHttpRequest()) {
            method.removeRequestHeader(HEADER_CONTENT_TYPE);
            method.addRequestHeader(HEADER_CONTENT_TYPE, entity.getContentType());
        }
        if (entity.getContentLength() < 0) {
            method.removeRequestHeader(HEADER_CONTENT_LENGTH);
        } else {
            method.setRequestHeader(HEADER_CONTENT_LENGTH, Long.toString(entity.getContentLength()));
        }
        if (endpoint.isSoap() && method.getRequestHeader(HEADER_SOAP_ACTION) == null) {
            if (endpoint.getSoapAction() != null) {
                method.setRequestHeader(HEADER_SOAP_ACTION, endpoint.getSoapAction());
            } else {
                method.setRequestHeader(HEADER_SOAP_ACTION, "\"\"");
            }
        }
        method.setRequestEntity(entity);
        boolean close = true;
        try {
            // Set the retry handler
            int retries = getConfiguration().isStreamingEnabled() ? 0 : getConfiguration().getRetryCount();
            method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(retries, true));
            // Set authentication
            if (endpoint.getBasicAuthentication() != null) {
                endpoint.getBasicAuthentication().applyCredentials(getClient(), exchange, nm);
            }
            // Execute the HTTP method
            int response = getClient().executeMethod(getHostConfiguration(locationURI, exchange, nm), method);
            if (response != HttpStatus.SC_OK && response != HttpStatus.SC_ACCEPTED) {
                if (!(exchange instanceof InOnly)) {
                    SoapReader reader = soapHelper.getSoapMarshaler().createReader();
                    Header contentType = method.getResponseHeader(HEADER_CONTENT_TYPE);
                    soapMessage = reader.read(method.getResponseBodyAsStream(),
                                              contentType != null ? contentType.getValue() : null);
                    context.setFaultMessage(soapMessage);
                    soapHelper.onAnswer(context);
                    Fault fault = exchange.createFault();
                    fault.setProperty(JbiConstants.PROTOCOL_HEADERS, getHeaders(method));
                    soapHelper.getJBIMarshaler().toNMS(fault, soapMessage);
                    exchange.setFault(fault);
View Full Code Here

Examples of org.apache.sis.internal.jaxb.Context

    /**
     * Delegates the marshalling to the wrapped marshaller.
     */
    @Override
    public void marshal(final Object object, final Result output) throws JAXBException {
        final Context context = begin();
        try {
            marshaller.marshal(object, output);
        } finally {
            context.finish();
        }
    }
View Full Code Here

Examples of org.apache.slide.projector.Context

    private final static String allowedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
   
    public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      ApplicationManager.getInstance();
      boolean sessionCreated = request.getSession(false) == null;
      Context context = new HttpContext(request, response);
        logger.log(Level.FINE, "Request uri=" + request.getRequestURI());
        logger.log(Level.FINE, "Context path=" + request.getContextPath());
        logger.log(Level.FINE, "Servlet path=" + request.getServletPath());
        URI uri = new URIValue(request.getRequestURI().substring(request.getContextPath().length()+request.getServletPath().length()+1));
        try {
            Result result;
            Processor processor;
            try {
                logger.log(Level.FINE, "Processing started with URI=" + uri);
                Map requestParameters = request.getParameterMap();
                if ( requestParameters.containsKey(Constants.PROCESS_ID_PARAMETER) ) {
                  context.setProcessId(requestParameters.get(Constants.PROCESS_ID_PARAMETER).toString());
                } else {
                    StringBuffer processIdBuffer = new StringBuffer(Constants.PROCESS_ID_LENGTH);
                  for ( int i = 0; i < Constants.PROCESS_ID_LENGTH; i++) {
                      processIdBuffer.append(allowedChars.charAt(random.nextInt(allowedChars.length())));
                  }
                  context.setProcessId(processIdBuffer.toString());
                }
                processor = ProcessorManager.getInstance().getProcessor(uri);
                Scheduler.getInstance();
                Scheduler.setContext(context);
              if ( sessionCreated ) {
                // new session
                    Scheduler.getInstance().launchSessionJobs(context);
              }
                Scheduler.getInstance().launchRequestJobs(context);
                if ( ProcessorManager.getInstance().getProcessorDescriptor(uri).isBookmark() ) {
                    context.setBookmark(uri);
                }
                ParameterDescriptor[] parameterDescriptors = processor.getParameterDescriptors();
                result = ProcessorManager.process(processor, new HashMap(requestParameters), context);
            } catch ( Exception exception ) {
                logger.log(Level.SEVERE, "Exception while processing processor with URI="+uri+"", exception);
View Full Code Here

Examples of org.apache.tapestry.services.Context

    public void request_for_favicon() throws IOException
    {
        Request request = newRequest("/favicon.ico");
        Response response = mockResponse();
        RequestHandler handler = mockRequestHandler();
        Context context = mockContext();

        replay();

        RequestFilter filter = new StaticFilesFilter(context);
View Full Code Here

Examples of org.apache.tapestry5.services.Context

    private final IdentityAssetPathConverter converter = new IdentityAssetPathConverter();

    @Test
    public void root_resource()
    {
        Context context = mockContext();
        // Request request = mockRequest();

        replay();

        AssetFactory factory = new ContextAssetFactory(null, context, converter);
View Full Code Here

Examples of org.apache.tomcat.Context

     *
     * @param uri Absolute URI of a resource on the server
     */
    public ServletContext getContext(String uri) {

  Context context = host.map(uri);
  if (context != null)
      return (context.getServletContext());
  else
      return (null);

    }
View Full Code Here

Examples of org.apache.tomcat.core.Context

      cm=(ContextManager)pageContext.getAttribute("cm");
      if( cm==null )
    throw new JspException( "Can't find context manager" );

      Context ctx=null;
      if( ctxPath==null && ctxPathParam!=null ) {
    ctxPath=req.getParameter( ctxPathParam );
      }

      if( docBase==null &&  docBaseParam!=null) {
    docBase=req.getParameter( docBaseParam );
      }
     
      if( ctxPath != null ) {
    if( debug>0 ) log("Finding " + ctxPath );
    Enumeration en=cm.getContexts();
    while( en.hasMoreElements() ) {
        ctx=(Context)en.nextElement();
        // XXX virtual host
        if( ctxPath.equals( ctx.getPath())) {
      pageContext.setAttribute("ctx", ctx);
      break;
        }
    }
      }
View Full Code Here

Examples of org.apache.tuscany.core.context.Context

            CompositeContext ctx = resolver.getCurrentContext();
            do {
                if (ctx == null) {
                    break; // reached top of context hierarchy
                }
                Context compContext = ctx.getContext(targetQualifiedName.getPartName());
                if (compContext != null) {
                    o = compContext.getInstance(targetQualifiedName);
                    if (o != null) {
                        return (T) o;
                    }
                }
                ctx = ctx.getParent();
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.