Package helma.framework.core

Examples of helma.framework.core.Application$Initializer


            if ((msg == null) || (msg.length() == 0)) {
                msg = x.toString();
            }
            retval.put("error", retval, msg);

            Application app = RhinoCore.getCore().getApplication();
            app.logError(msg, x);
        }

        return retval;

    }
View Full Code Here


        // init a server instance and start the application
        Server server = new Server(config);
        server.init();
        server.checkAppManager();
        server.startApplication(appName);
        Application app = server.getApplication(appName);

        // execute the function
        try {
            Object result = app.executeExternal(function, funcArgs);
            if (result != null) {
                System.out.println(result.toString());
            }
        } catch (Exception ex) {
            System.out.println("Error in application " + appName + ":");
View Full Code Here

     */
    private void createSession(HttpServletResponse response,
                               String prefix,
                               RequestTrans reqtrans,
                               String domain) {
        Application app = getApplication();
        String id = null;
        while (id == null || app.getSession(id) != null) {
            long l = secureRandom ?
                    random.nextLong() :
                    random.nextLong() + Runtime.getRuntime().freeMemory() ^ hashCode();
            if (l < 0)
                l = -l;
            id = prefix + Long.toString(l, 36);
        }

        reqtrans.setSession(id);

        StringBuffer buffer = new StringBuffer(sessionCookieName);
        buffer.append("=").append(id).append("; Path=/");
        if (domain != null) {
            // lowercase domain for IE
            buffer.append("; Domain=").append(domain.toLowerCase());
        }
        if (!"false".equalsIgnoreCase(app.getProperty("httpOnlySessionCookie"))) {
            buffer.append("; HttpOnly");
        }
        if ("true".equalsIgnoreCase(app.getProperty("secureSessionCookie"))) {
            buffer.append("; Secure");
        }
        response.addHeader("Set-Cookie", buffer.toString());
    }
View Full Code Here

            ServerConfig config = new ServerConfig();
            config.setHomeDir(hopHome);
            Server server = new Server(config);
            server.init();

            app = new Application(appName, server, repositories, appHome, dbHome);
            app.init();
            app.start();
        } catch (Exception x) {
            log("Error starting Application " + appName + ": " + x);
            x.printStackTrace();
View Full Code Here

     *             "collection(Type)", but for relations defined from
     *             JavaScript, it is the top level descriptor object.
     * @param props The subproperties for this relation.
     */
    public void update(Object desc, Properties props) {
        Application app = ownType.getApplication();

        if (desc instanceof Properties || parseDescriptor(desc, props)) {
            // converted to internal foo.collection = Bar representation
            String proto;
            if (props.containsKey("collection")) {
                proto = props.getProperty("collection");
                virtual = !"_children".equalsIgnoreCase(propName);
                reftype = COLLECTION;
            } else if (props.containsKey("mountpoint")) {
                proto = props.getProperty("mountpoint");
                reftype = COLLECTION;
                virtual = true;
                this.prototype = proto;
            } else if (props.containsKey("object")) {
                proto = props.getProperty("object");
                if (reftype != COMPLEX_REFERENCE) {
                    reftype = REFERENCE;
                }
                virtual = false;
            } else {
                throw new RuntimeException("Invalid property Mapping: " + desc);
            }

            otherType = app.getDbMapping(proto);

            if (otherType == null) {
                throw new RuntimeException("DbMapping for " + proto +
                                           " not found from " + ownType.getTypeName());
            }
View Full Code Here

TOP

Related Classes of helma.framework.core.Application$Initializer

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.