Examples of DependenciesBean


Examples of org.springframework.tests.sample.beans.DependenciesBean

  }

  @Test
  public void testAutowireExistingBeanByTypeWithDependencyCheck() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
    DependenciesBean existingBean = new DependenciesBean();
    try {
      lbf.autowireBeanProperties(existingBean, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, true);
      fail("Should have thrown UnsatisfiedDependencyException");
    }
    catch (UnsatisfiedDependencyException expected) {
View Full Code Here

Examples of org.springframework.tests.sample.beans.DependenciesBean

  }

  @Test
  public void testAutowireExistingBeanByTypeWithNoDependencyCheck() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
    DependenciesBean existingBean = new DependenciesBean();
    lbf.autowireBeanProperties(existingBean, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, false);
    assertNull(existingBean.getSpouse());
  }
View Full Code Here

Examples of org.wso2.carbon.registry.relations.beans.DependenciesBean

public class DependenciesBeanPopulator {

    public static DependenciesBean populate(UserRegistry userRegistry, String path) {

        DependenciesBean dependenciesBean = new DependenciesBean();
        ResourcePath resourcePath = new ResourcePath(path);
        try {
            Association[] asso = CommonUtil.getAssociations(userRegistry,
                    (resourcePath.isCurrentVersion() ?
                            resourcePath.getPath() : resourcePath.getPathWithVersion()));
            Resource resource = userRegistry.get(path);

            AssociationBean[] beans = new AssociationBean[asso.length];
            for (int i = 0; i < beans.length; i++) {
                Association as = asso[i];
                beans[i] = new AssociationBean(as.getSourcePath(), as.getDestinationPath(),
                        as.getAssociationType());

            }
            dependenciesBean.setAssociationBeans(beans);

            dependenciesBean.setVersionView(!resourcePath.isCurrentVersion());
            dependenciesBean.setPathWithVersion(resourcePath.getPathWithVersion());
            List mountPoints = resource.getPropertyValues("registry.mountpoint");
            List targetPoints = resource.getPropertyValues("registry.targetpoint");
//            List paths = resource.getPropertyValues("registry.path");
            List actualPaths = resource.getPropertyValues("registry.actualpath");
            String user = resource.getProperty("registry.user");
            if (resource.getProperty("registry.link") != null) {

                if(mountPoints != null && targetPoints != null) {
//                    String mountPoint = (String)mountPoints.get(0);
//                    String targetPoint = (String)targetPoints.get(0);
//                        String tempPath;
//                        if (targetPoint.equals(RegistryConstants.PATH_SEPARATOR) && !path.equals(mountPoint)) {
//                            tempPath = ((String)paths.get(0)).substring(mountPoint.length());
//                        } else {
//                            tempPath = targetPoint + ((String)paths.get(0)).substring(mountPoint.length());
//                        }
                    String tempPath = (String)actualPaths.get(0);
                    dependenciesBean.setPutAllowed(
                            UserUtil.isPutAllowed(userRegistry.getUserName(), tempPath, userRegistry));
                } else if (user != null) {
                    if (userRegistry.getUserName().equals(user)) {
                        dependenciesBean.setPutAllowed(true);
                    } else {
                        dependenciesBean.setPutAllowed(UserUtil.isPutAllowed(
                                userRegistry.getUserName(), path, userRegistry));
                    }
                    }
            } else {
                dependenciesBean.setPutAllowed(UserUtil.isPutAllowed(userRegistry.getUserName(), path, userRegistry));
            }
            dependenciesBean.setLoggedIn(!RegistryConstants.ANONYMOUS_USER.equals(userRegistry.getUserName()));
        } catch (RegistryException e) {

            String msg = "Failed to get dependencies of resource " +
                    resourcePath + ". " + e.getMessage();
            dependenciesBean.setErrorMessage(msg);
        }

        return dependenciesBean;
    }
View Full Code Here

Examples of org.wso2.carbon.registry.relations.stub.beans.xsd.DependenciesBean

    public DependenciesBean getDependencies(HttpServletRequest request) throws Exception {

        String path = request.getParameter("path");

        DependenciesBean bean = null;
        try {
            bean = stub.getDependencies(path);
            if (bean.getAssociationBeans() == null) {
                bean.setAssociationBeans(new AssociationBean[0]);
            }
        } catch (Exception e) {
            String msg = "Failed to get associations from the service. " +
                    e.getMessage();
            log.error(msg, e);
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.