Examples of RegistryContext


Examples of org.wso2.carbon.registry.core.config.RegistryContext


    // Defines the fixed mount points.
    private void defineFixedMount(Registry registry, String path, boolean isSuperTenant)
            throws RegistryException {
        RegistryContext registryContext = registry.getRegistryContext();
        String relativePath = RegistryUtils.getRelativePath(registryContext, path);
        String lookupPath = RegistryUtils.getAbsolutePath(registryContext,
                RegistryConstants.LOCAL_REPOSITORY_BASE_PATH +
                        RegistryConstants.SYSTEM_MOUNT_PATH) + "/" +
                relativePath.replace("/", "-");
View Full Code Here

Examples of org.wso2.carbon.registry.core.config.RegistryContext

    }

    // Determines whether a given mount point is a fixed mount or not.
    private boolean isFixedMount(Registry registry, String path, String targetPath,
                                 boolean isSuperTenant) throws RegistryException {
        RegistryContext registryContext = registry.getRegistryContext();
        String relativePath = RegistryUtils.getRelativePath(registryContext, path);
        String lookupPath = RegistryUtils.getAbsolutePath(registryContext,
                RegistryConstants.LOCAL_REPOSITORY_BASE_PATH +
                        RegistryConstants.SYSTEM_MOUNT_PATH) + "/" +
                relativePath.replace("/", "-");
View Full Code Here

Examples of org.wso2.carbon.registry.core.config.RegistryContext

            boolean isSuperTenant = (tenantId == MultitenantConstants.SUPER_TENANT_ID);
            Registry superTenantRegistry = registryService.getRegistry(
                    CarbonConstants.REGISTRY_SYSTEM_USERNAME);
            Registry registry = registryService.getRegistry(
                    CarbonConstants.REGISTRY_SYSTEM_USERNAME, tenantId);
            RegistryContext registryContext = superTenantRegistry.getRegistryContext();
            for (Mount mount : registryContext.getMounts()) {
                if (isFixedMount(registry, mount.getPath(), mount.getTargetPath(), isSuperTenant)) {
                    addFixedMount(tenantId, superTenantRegistry, mount.getPath());
                    continue;
                }
                if (!registry.resourceExists(mount.getPath())) {
View Full Code Here

Examples of org.wso2.carbon.registry.core.config.RegistryContext

    private void addFixedMount(int tenantId, Registry registry, String path)
            throws RegistryException {
        CurrentSession.setCallerTenantId(tenantId);
        try {
            RegistryContext registryContext = registry.getRegistryContext();
            String relativePath = RegistryUtils.getRelativePath(registryContext, path);
            String lookupPath = RegistryUtils.getAbsolutePath(registryContext,
                    RegistryConstants.LOCAL_REPOSITORY_BASE_PATH +
                            RegistryConstants.SYSTEM_MOUNT_PATH) + "/" +
                    relativePath.replace("/", "-");
View Full Code Here

Examples of org.wso2.carbon.registry.core.config.RegistryContext

        if (log.isTraceEnabled()) {
            log.trace("Registering the built-in handlers.");
        }
        Registry registry = registryService.getRegistry(
                CarbonConstants.REGISTRY_SYSTEM_USERNAME);
        RegistryContext registryContext = registry.getRegistryContext();
        HandlerManager handlerManager = registryContext.getHandlerManager();

        if (log.isTraceEnabled()) {
            log.trace("Engaging the Operation Statistics Handler.");
        }
        // handler to record system statistics
View Full Code Here

Examples of org.wso2.carbon.registry.core.config.RegistryContext

    // Gets registry service for the Embedded Registry
    private RegistryService getEmbeddedRegistryService() throws Exception {

        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

Examples of org.wso2.carbon.registry.core.config.RegistryContext

    }

    public void start() throws Exception {

        RealmService realmService = new InMemoryRealmService();
        RegistryContext regContext = RegistryContext.getBaseInstance(realmService);
        regContext.selectDBConfig("in-memory");
        //RegistryContext.setSingleton(regContext);

        server = new Server(port);
        Context context = new Context(server, null/*RegistryProvider.baseURI*/, Context.SESSIONS);
        ServletHolder servletHolder = new ServletHolder(new AbderaServlet());
View Full Code Here

Examples of org.wso2.carbon.registry.core.config.RegistryContext

            throws RegistryException {
        boolean evaluateExports = true;

        String resourcePath = context.getResourcePath().getPath();
        resourceName = resourcePath.substring(resourcePath.lastIndexOf(RegistryConstants.PATH_SEPARATOR) + 1);
        RegistryContext registryContext = context.getRegistryContext();
        // 3rd parameter is false, for importing WSDLs.
        evaluateWSDLsToDefinitions(wsdlURL, context, evaluateExports, false, isPut, skipValidation);
        String wsdlPath = "";
        for (WSDLInfo wsdlInfo : wsdls.values()) {
            Definition wsdlDefinition = wsdlInfo.getWSDLDefinition();
View Full Code Here

Examples of org.wso2.carbon.registry.core.config.RegistryContext

        if (!ACTION.equals(action)) {
            throw new RegistryException("Unsupported lifecycle action '" + action +
                                        "'.  Only valid action is '" + ACTION + "'");
        }

        RegistryContext registryContext = context.getRegistry().getRegistryContext();
        Repository repository = registryContext.getRepository();

        Resource resource = context.getResource();
        String originalPath = resource.getProperty(ORIGINAL_PATH);
        if (originalPath == null ) {
            resource.setProperty(ORIGINAL_PATH , resource.getPath());
View Full Code Here

Examples of org.wso2.carbon.registry.core.config.RegistryContext

        return userDefinedValue || defaultValue;
    }

    @Override
    public RegistryContext getRegistryContext(RequestContext requestContext) {
        RegistryContext defaultValue = handlerManagers.get(
                DEFAULT_SYSTEM_HANDLER_PHASE).getRegistryContext(requestContext);
        boolean isProcessingComplete = requestContext.isProcessingComplete();
        if (!isProcessingComplete) {
            RegistryContext tenantSpecificValue = handlerManagers.get(
                    TENANT_SPECIFIC_SYSTEM_HANDLER_PHASE).getRegistryContext(requestContext);
            if (tenantSpecificValue != null) {
                defaultValue = tenantSpecificValue;
            }
            isProcessingComplete = requestContext.isProcessingComplete();
        }
        requestContext.setProcessingComplete(false);
        RegistryContext userDefinedValue = handlerManagers.get(
                USER_DEFINED_HANDLER_PHASE).getRegistryContext(requestContext);
        isProcessingComplete |= requestContext.isProcessingComplete();
        // The reporting handler phase needs to know about the state of processing
        requestContext.setProcessingComplete(isProcessingComplete);
        handlerManagers.get(DEFAULT_REPORTING_HANDLER_PHASE).getRegistryContext(requestContext);
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.