Examples of Volantis


Examples of com.volantis.mcs.runtime.Volantis

        }
        MPSAppConfigurator appConf = new MPSAppConfigurator();

        appConf.setPluginConfigValue(mps);
        // Set appConf in AppManager
        volantisBean = new Volantis();
        ServletContextStub servletContext = new ServletContextStub();
        AppManager am = new AppManager(volantisBean, servletContext);
        am.setAppConf(appConf);
        PluginConfigFileBuilder builder = new MPSPluginConfigBuilder();
        am.registerPluginConfigFileBuilder(builder, mps.getClass());
View Full Code Here

Examples of com.volantis.mcs.runtime.Volantis

     * create instead of using the member variable.
     * @param context the MyMarinerPageContext to set up.
     */
    private void setUpContext(MyMarinerPageContext context) {
        testRequestContext = new TestMarinerRequestContext();
        volantis = new Volantis();
        servletContext = new ServletContextStub();
        testRequestContext = new TestMarinerRequestContext();

        context.setVolantisBean(volantis);
        // Register a dummy EnvironmentContext against the request context
View Full Code Here

Examples of com.volantis.mcs.runtime.Volantis

                // already been created. In this case we should create the
                // MarinerServletApplication to wrap the existing Volantis bean.
                if (!create) {
                    // Look for the Volantis bean and if it is available then
                    // create a MarinerServletApplication which wraps it.
                    final Volantis volantisBean = findVolantisBean(context);
                    if (volantisBean == null) {
                        // Return immediately to avoid dropping through to the
                        // following code.
                        return null;
                    }
View Full Code Here

Examples of com.volantis.mcs.runtime.Volantis

     * @return The identified Device.
     * @throws RepositoryException If there is a problem retrieving the Device.
     */
    public Device getDevice(HttpServletRequest request)
            throws RepositoryException {
        Volantis volantisBean = ApplicationInternals.getVolantisBean(this);

        if (volantisBean == null) {
            throw new IllegalStateException("MCS Application not initialised");
        }

        // Get the session
        HttpSession session = request.getSession(true);

        if (logger.isDebugEnabled()) {
            logger.debug("Session information: " + session.toString());
            logger.debug("Session max interval time: " +
                    session.getMaxInactiveInterval());
        }

        // See if the device has previously been stored in the session and
        // use it if it has.
        DefaultDevice device = (DefaultDevice)
                session.getAttribute(SESSION_DEVICE_NAME);
        // Throw away devices which were constructed via serialisation
        // from persisted sessions, since we do not properly support
        // serialisation for now.
        if (device != null && !device.isValid()) {
            device = null;
        }

        // No device in the session, so we need to ID it.
        if(device == null) {

            // Use the device repository to retrieve the device.
            DeviceRepository deviceRepository;
            try {
                deviceRepository = getRuntimeDeviceRepository();

                HttpHeaders headers = servletFactory.getHTTPHeaders(request);
                String defaultDeviceName = volantisBean.getDevicesConfiguration().getDefaultDeviceName();

                // null value of defaultDeviceName is OK, it means that
                // we let DeviceRepository subsystem use its own default               
                device = (DefaultDevice) deviceRepository
                        .getDevice(headers, defaultDeviceName);
View Full Code Here

Examples of com.volantis.mcs.runtime.Volantis

            if(logger.isDebugEnabled()){
                logger.debug("Registered default application");
            }

            // Get the Volantis bean, creating it if necessary.
            Volantis volantisBean = getVolantisBean(servletContext);

            // Store a reference to it in this MarinerApplication instance.
            ApplicationInternals.setVolantisBean(this, volantisBean);

            // The last thing to do is remember that this has been initialized
View Full Code Here

Examples of com.volantis.mcs.runtime.Volantis

    private Volantis getVolantisBean(ServletContext context)
            throws ConfigurationException {

        // Look in the ServletContext to see if an instance has already been
        // created for this ServletContext.
        Volantis volantis = findVolantisBean(context);

        // If it could not be found then create one and store it away.
        if (volantis == null) {
            volantis = new Volantis();
            context.setAttribute(MARINER_VOLANTIS_NAME, volantis);
        }

        // Create a mapper between external paths and internal URLs.
        ExternalPathToInternalURLMapper pathURLMapper;
        pathURLMapper = new ServletExternalPathToInternalURLMapper(
                servletContext);

        // Always call the initialize method to match the behaviour of the code
        // generated by the jsp:usebean directive.
        ConfigContext cc = new ServletConfigContext(context);
        volantis.initializeInternal(pathURLMapper, cc, this);

        return volantis;
    }
View Full Code Here

Examples of com.volantis.mcs.runtime.Volantis

     */
    protected void process( HttpServletRequest request,
                            HttpServletResponse response)
        throws ServletException, IOException {
           
        Volantis bean = getVolantisBean();
        MarinerServletRequestContext context =
                                getMarinerRequestContext( request, response );
                               
        String dev = context.getDeviceName();
           
View Full Code Here

Examples of com.volantis.mcs.runtime.Volantis

   
    /**
     * Test the method elementEnd.    
     */
    public void doTestElementEnd(String invokeMethod) throws Exception {
        Volantis volantis = new TestableVolantis();
        ServletContextStub contextStub = new ServletContextStub();
       
        AppManager appManager = new AppManager(volantis, contextStub);
        appManager.setAppConf(new MinimalXmlRepositoryAppConfigurator() {
            public void setUp(ConfigValue config) throws Exception {
View Full Code Here

Examples of com.volantis.mcs.runtime.Volantis

    /**
     * Returns TestMarinerPageContext
     * @return the MarinerPageContext
     */
    private MarinerPageContext getPageContext() throws Exception {
        Volantis volantis = new TestableVolantis();
        ServletContextStub servletContext = new ServletContextStub();
        AppManager appManager = new AppManager(volantis, servletContext);       
        appManager.useAppWith(new AppExecutor() {
            public void execute(AppContext context) throws Exception {
                String err = context.getConsoleOutput().getErr();
View Full Code Here

Examples of com.volantis.mcs.runtime.Volantis

     * @param protocol The protocol to set up.
     */
    private static void setupProtocol(
            ExpectationBuilder expectations, VolantisProtocol protocol)
            throws Exception {
        Volantis volantis = new Volantis();
        TestMarinerPageContext pageContext = new TestMarinerPageContext();
        pageContext.setVolantis(volantis);
        // Initialise the device.
        pageContext.setDeviceName("Unknown Device");
        InternalDevice device = InternalDeviceTestHelper.createTestDevice();
        pageContext.setDevice(device);

        pageContext.setProtocol(protocol);
        // Set the protocols configuration
        ProtocolsConfiguration config = new ProtocolsConfiguration();
        config.setWmlPreferredOutputFormat("wml");
        volantis.setProtocolsConfiguration(config);


        MarinerRequestContext requestContext =
                ProtocolTestAbstract.initialiseMarinerRequestContext(
                        expectations);
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.