Package com.volantis.mcs.context

Examples of com.volantis.mcs.context.MarinerSessionContext


    //javadoc inherited
    public MarinerSessionContext createSessionContext ()
        throws RepositoryException {
           
        // Create a new MarinerSessionContext.
        MarinerSessionContext sessionContext
            = new MarinerSessionContext();

        return sessionContext;   
    }
View Full Code Here


                                         InternalRequest request,
                                         InternalResponse response,
                                         EnvironmentContext context)
            throws IOException, MarinerContextException {

        MarinerSessionContext sessionContext = null;
        ExpressionContext expressionContext = null;
        if (context != null) {
            sessionContext = context.getCurrentSessionContext();
            expressionContext = context.getExpressionContext();
        }
View Full Code Here

    protected InternalDevice resolveDevice(Volantis volantisBean,
                                           MarinerRequestContext requestContext)
            throws RepositoryException {

        InternalDevice device = null;
        MarinerSessionContext sessionContext =
                ContextInternals.getEnvironmentContext(requestContext)
                .getSessionContext();

        // We only want to resolve the device once per session.
        device = sessionContext.getDevice();
        if (device == null) {
            DeviceReader reader = volantisBean.getDeviceReader();
            device = resolveDevice(reader, requestContext);
        }
View Full Code Here

     * @param context the page context
     * @return true if the asset should be added to the package
     */
    protected boolean isToBeAdded(String assetURL,
                                  MarinerPageContext context) {
        MarinerSessionContext sc = context.getSessionContext();

        // A size of zero is the guaranteed initial value for the cache
        // model size in the session context. If this value is seen, the
        // cache model needs to be initialized
        if (sc.getDeviceAssetCacheMaxSize() == 0) {
            int cacheSize = 0;
            String cacheSizeAsString =
                context.getDevicePolicyValue(
                    "protocol.mime.urls.to.cache");

            if (cacheSizeAsString != null) {
                try {
                    cacheSize = Integer.valueOf(
                        cacheSizeAsString).intValue();
                } catch (NumberFormatException e) {
                    cacheSize = 0;
                }
            }

            if (cacheSize == 0) {
                // Specifically set the value in the session context to a
                // non-zero but "disabled" value so we know that the device
                // policy value has previously been checked and set in the
                // session context
                sc.setDeviceAssetCacheMaxSize(-1);
            } else {
                sc.setDeviceAssetCacheMaxSize(cacheSize);
            }
        }

        // NB: the session context will return false if the cache model is
        // disabled
        return !sc.isAssetCached(assetURL);
    }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.context.MarinerSessionContext

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.