Package org.wso2.carbon.registry.core

Examples of org.wso2.carbon.registry.core.CollectionImpl.discard()


                        // don't override the param if it already exists and locked..
                        if (!(p != null && p.isLocked())) {
                            ad.addParameter(parameter);
                        }
                    }
                    param.discard();
                }
                adParameters.discard();
            }
        }
    }
View Full Code Here


                    Resource paramResource = configRegistry.newResource();
                    paramResource.setContent(parameter.getParameterElement().toString());
                    paramResource.addProperty(RegistryResources.NAME, parameter.getName());
                    configRegistry.put(adPath + RegistryResources.PARAMETERS
                            + parameter.getName(), paramResource);
                    paramResource.discard();
                }
            }
        }
    }
View Full Code Here

     * @throws RegistryException - on registry error
     */
    protected List getPropertyValues(String resourcePath, String property) throws RegistryException {
        Resource resource = configRegistry.get(resourcePath);
        List values = resource.getPropertyValues(property);
        resource.discard();
        return values;
    }

    /**
     * Load the documentation of an AxisDescription instance
View Full Code Here

                    Resource policyResource = configRegistry.get(policyResourcePath);
                    if (!(policyResource instanceof Collection)) {
                        Policy policy = PolicyEngine.getPolicy(policyResource.getContentStream());
                        ad.getPolicySubject().attachPolicy(policy);
                    }
                    policyResource.discard();
                } else {
                    log.error("Failed to load Policy with ID " + currentPolicyUUID
                            + ". The Policy does not exist.");
                }
            }
View Full Code Here

    protected boolean isGloballyEngaged(String resourcePath) throws RegistryException {
        if (configRegistry.resourceExists(resourcePath)) {
            Resource resource = configRegistry.get(resourcePath);
            boolean globallyEngaged = Boolean.parseBoolean(resource
                    .getProperty(RegistryResources.ModuleProperties.GLOBALLY_ENGAGED));
            resource.discard();
            return globallyEngaged;
        }
        return false;
    }
View Full Code Here

        }
        AxisModule existingModule = null;
        if (configRegistry.resourceExists(modulePath)) {
            Resource givenResource = configRegistry.get(modulePath);
            existingModule = getAxisModule(givenResource);
            givenResource.discard();
        }
        // if the existingModule is null, check whether there are new versions..
        if (existingModule == null) {
            String temp = modulePath.substring(0, modulePath.lastIndexOf('/'));
            if (configRegistry.resourceExists(temp)) {
View Full Code Here

                // exists in the system
                for (String versionPath : moduleVersions.getChildren()) {
                    Resource versionResource = configRegistry.get(versionPath);
                    existingModule = getAxisModule(versionResource);
                    if (existingModule != null) {
                        versionResource.discard();
                        break;
                    }
                    versionResource.discard();
                }
                moduleVersions.discard();
View Full Code Here

            Resource resource2 = registry.get(path);

            assertEquals("File content is not matching", new String((byte[]) resource.getContent()),
                    new String((byte[]) resource2.getContent()));

            resource.discard();
            res1.discard();
            resource1.discard();
            resource2.discard();
            Thread.sleep(100);
        }
View Full Code Here

                        }
                    }
                }
            }
            registry.put(path, resourceImpl);
            resourceImpl.discard();

        } catch (Exception e) {

            String msg = "Failed to add resource " + path + ". " + ((e.getCause() instanceof SQLException) ?
                    "" : e.getMessage());
View Full Code Here

            Resource resource2 = registry.get(path);

            assertEquals("File content is not matching", new String((byte[]) resource.getContent()),
                    new String((byte[]) resource2.getContent()));

            resource.discard();
            res1.discard();
            resource1.discard();
            resource2.discard();
            Thread.sleep(100);
        }
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.