Package org.wso2.carbon.registry.core.jdbc

Examples of org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService


   
    protected static SVGImpl generateSVGImpl(java.io.InputStream is) throws java.io.IOException {
      byte[] b=new byte[is.available()];
      is.read(b);
   
      BPELInterface bpel = new BPELImpl();
        OMElement bpelStr = bpel.load(new String(b));
       
        bpel.processBpelString(bpelStr);

        LayoutManager layoutManager = BPEL2SVGFactory.getInstance().getLayoutManager();
        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here


   * @param transformer The optional image transformer
   * @throws java.io.IOException Failed to generate the representation
   */
    public static void generate(java.io.InputStream is, java.io.OutputStream os,
                SVGImageTransformer transformer) throws java.io.IOException {
        SVGImpl svg = generateSVGImpl(is);
       
        if (transformer == null) {
          String str=svg.getHeaders()+svg.generateSVGString();
          os.write(str.getBytes());
        } else {
          transformer.transform(svg, os);
        }
    }
View Full Code Here

        layoutManager.setVerticalLayout(true);
        layoutManager.setYSpacing(20);
        layoutManager.setYSpacing(50);
        layoutManager.layoutSVG(bpel.getRootActivity());

        SVGImpl svg = new SVGImpl();
        svg.setRootActivity(bpel.getRootActivity());
       
        return(svg);
    }
View Full Code Here

     *                           failed.
     */
    public EmbeddedRegistryService getEmbeddedRegistryService() throws RegistryException {
        if (embeddedRegistryService == null) {
            try {
                embeddedRegistryService = new EmbeddedRegistryService(this);
            } catch (RegistryException e) {
                String msg = "Couldn't initialize EmbeddedRegistryService. " + e.getMessage();
                log.error(msg, e);
                throw new RegistryException(msg, e);
            }
View Full Code Here

    //To store the context path
    private String contextRoot = null;

    public void init(final ServletConfig config) throws ServletException {
        super.init(config);
        EmbeddedRegistryService embeddedRegistryService;

        try {
            // read the registry.xml file from the configured location. if not configured, read the
            // default registry.xml file bundled with the webapp.
            String configPath = config.getInitParameter(RegistryConstants.REGISTRY_CONFIG_PATH);
            InputStream configStream;
            if (configPath != null) {
                try {
                    configStream = new FileInputStream(configPath);
                } catch (FileNotFoundException e) {
                    throw new ServletException("Couldn't find specified config file '" +
                            configPath + "'", e);
                }
            } else {
                configStream =
                        config.getServletContext().getResourceAsStream("/WEB-INF/registry.xml");
            }

            RegistryContext registryContext = RegistryContext.getBaseInstance(configStream,
                    new RegistryContext.RegURLSupplier() {
                        public String getURL() {
                            return config.getServletContext().getRealPath("/WEB-INF");
                        }
                    });

            embeddedRegistryService = registryContext.getEmbeddedRegistryService();

            // create a system registry and put it in the context
            UserRegistry systemRegistry = embeddedRegistryService.getConfigSystemRegistry();

            // add configured handers to the jdbc registry
            // note: no need to do this here. this is done inside the registry context
            //Iterator<HandlerConfiguration> handlers =
            //        registryContext.getHandlerConfigurations().iterator();
View Full Code Here

            // user is not logged in. create a anonymous userRegistry for the user.

            ServletContext context = request.getSession().getServletContext();

            EmbeddedRegistryService embeddedRegistryService =
                    (EmbeddedRegistryService) context.getAttribute(RegistryConstants.REGISTRY);

            userRegistry = embeddedRegistryService.getRegistry();
            request.getSession()
                    .setAttribute(RegistryConstants.ROOT_REGISTRY_INSTANCE, userRegistry);
        }

        return userRegistry;
View Full Code Here

        UserRegistry registry;
        Object o = request.getSession().getAttribute(RegistryConstants.ROOT_REGISTRY_INSTANCE);
        if (o != null) {
            registry = (UserRegistry) o;
        } else {
            EmbeddedRegistryService embeddedRegistryService = (EmbeddedRegistryService) request.
                    getSession().getServletContext().getAttribute(RegistryConstants.REGISTRY);

            registry = embeddedRegistryService.getRegistry();

            request.getSession().setAttribute(RegistryConstants.ROOT_REGISTRY_INSTANCE, registry);
        }
        return registry;
    }
View Full Code Here

    public static void logInUser(HttpServletRequest request, String userName, String password)
            throws RegistryException {

        ServletContext context = request.getSession().getServletContext();
        EmbeddedRegistryService embeddedRegistryService =
                (EmbeddedRegistryService) context.getAttribute(RegistryConstants.REGISTRY);

        UserRegistry userRegistry =
                embeddedRegistryService.getConfigUserRegistry(userName, password);

        request.getSession().setAttribute(RegistryConstants.ROOT_REGISTRY_INSTANCE, userRegistry);
    }
View Full Code Here

        InputStream configInputStream = new FileInputStream(getConfigFile());
        RegistryContext registryContext =
                RegistryContext.getBaseInstance(configInputStream, realmService);
        registryContext.setSetup(System.getProperty(RegistryConstants.SETUP_PROPERTY) != null);
        return new EmbeddedRegistryService(registryContext);
    }
View Full Code Here

    public void setUp() throws RegistryException {
        super.setUp();
        if (registry == null) {
            super.setUp();
            EmbeddedRegistryService embeddedRegistry = ctx.getEmbeddedRegistryService();
            registry = embeddedRegistry.getGovernanceUserRegistry("admin", "admin");
        }
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.registry.core.jdbc.EmbeddedRegistryService

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.