Examples of ProfileManager


Examples of com.sk89q.skmcl.profile.ProfileManager

    @Getter private final Configuration configuration;
    private LauncherFrame mainFrame;

    public Launcher(@NonNull File baseDir) {
        this.baseDir = baseDir;
        this.profiles = new ProfileManager(baseDir);
        this.accounts = Persistence.load(new File(baseDir, "accounts.dat"), AccountList.class);
        this.configuration = Persistence.load(new File(baseDir, "config.json"), Configuration.class);

        if (accounts.getSize() > 0) {
            accounts.setSelectedItem(accounts.getElementAt(0));
View Full Code Here

Examples of com.taobao.zeus.store.ProfileManager

    // 处理脚本中的 资源引用 语句
    script = resolvScriptResource(resources, script, applicationContext);
    jobContext.setResources(resources);
    hp.setProperty(PropertyKeys.JOB_SCRIPT, script);
    FileManager fileManager=(FileManager) applicationContext.getBean("fileManager");
    ProfileManager profileManager=(ProfileManager) applicationContext.getBean("profileManager");
    String owner=fileManager.getFile(history.getFileId()).getOwner();
    Profile profile=profileManager.findByUid(owner);
    if(profile!=null && profile.getHadoopConf()!=null){
      for(String key:profile.getHadoopConf().keySet()){
        hp.setProperty(key, profile.getHadoopConf().get(key));
      }
    }
View Full Code Here

Examples of io.fabric8.api.ProfileManager

    }
   
    @Test
    public void testProfileManager() throws Exception {
       
        ProfileManager profileManager = ProfileManagerLocator.getProfileManager();
       
        // fabric:profile-create prfA
        ProfileBuilder pbA10 = ProfileBuilder.Factory.create("1.0", "prfA")
                .addConfiguration("pidA", Collections.singletonMap("keyA", "valA"));
        Profile prfA10 = profileManager.createProfile(pbA10.getProfile());
        Assert.assertEquals("1.0", prfA10.getVersion());
        Assert.assertEquals("prfA", prfA10.getId());
        Assert.assertEquals("valA", prfA10.getConfiguration("pidA").get("keyA"));
       
        // Verify access to original profile
        profileManager.getRequiredVersion("1.0").getRequiredProfile("prfA");
       
        // fabric:version-create --parent 1.0 1.1
        Version v11 = profileManager.createVersionFrom("1.0", "1.1", null);
        Profile prfA11a = v11.getRequiredProfile("prfA");
        Assert.assertEquals("1.1", prfA11a.getVersion());
        Assert.assertEquals("prfA", prfA11a.getId());
        Assert.assertEquals("valA", prfA11a.getConfiguration("pidA").get("keyA"));
       
        // Verify access to original profile
        profileManager.getRequiredVersion("1.0").getRequiredProfile("prfA");
        profileManager.getRequiredVersion("1.1").getRequiredProfile("prfA");
       
        ProfileBuilder pbA11 = ProfileBuilder.Factory.createFrom(prfA11a)
                .addConfiguration("pidA", Collections.singletonMap("keyB", "valB"));
        Profile prfA11b = profileManager.updateProfile(pbA11.getProfile());
        Assert.assertEquals("1.1", prfA11b.getVersion());
        Assert.assertEquals("prfA", prfA11b.getId());
        Assert.assertEquals("valB", prfA11b.getConfiguration("pidA").get("keyB"));
       
        Assert.assertNotEquals(prfA11a, prfA11b);
        // System.out.println(Profiles.getProfileDifference(prfA11a, prfA11b));
       
        // Verify access to original profile
        profileManager.getRequiredVersion("1.0").getRequiredProfile("prfA");
        profileManager.getRequiredVersion("1.1").getRequiredProfile("prfA");
       
        // Delete the profile/version that were added
        profileManager.deleteProfile(prfA10.getVersion(), prfA10.getId(), true);
        profileManager.deleteVersion(v11.getId());
    }
View Full Code Here

Examples of net.sourceforge.fullsync.ProfileManager

    this.guiController = initGuiController;
    initGUI();

    getShell().addShellListener(this);

    ProfileManager pm = guiController.getProfileManager();
    pm.addSchedulerListener(this);
    pm.addSchedulerChangeListener(this);
    guiController.getSynchronizer().getTaskGenerator().addTaskGenerationListener(this);

    // REVISIT [Michele] Autogenerated event? I don't like it!
    schedulerStatusChanged(pm.isSchedulerEnabled());
  }
View Full Code Here

Examples of org.apache.cocoon.portal.profile.ProfileManager

    throws ProcessingException {
        PortalService portalService = null;
        try {
            portalService = (PortalService) manager.lookup(PortalService.ROLE);
               
            ProfileManager profileManager = portalService.getComponentManager().getProfileManager();
            CopletInstanceData data = profileManager.getCopletInstanceData(copletID);
            return data;
        } catch (ServiceException e) {
            throw new ProcessingException("Error getting portal service.", e);
        } finally {
            manager.release(portalService);
View Full Code Here

Examples of org.apache.cocoon.portal.profile.ProfileManager

        CopletData data = (CopletData) ((CopletDataEvent)e).getTarget();
        PortalService service = null;
        List instances = null;
        try {
            service = (PortalService) this.manager.lookup(PortalService.ROLE);
            ProfileManager profileManager = service.getComponentManager().getProfileManager();
            instances = profileManager.getCopletInstanceData(data);
        } catch (Exception ignore) {
            // ignore exception
        } finally {
            this.manager.release(service);
        }
View Full Code Here

Examples of org.apache.cocoon.portal.profile.ProfileManager

     * @param   coplet  the coplet instance data
     * @trows  ProcessingException if something fails in the creation process
     */
    private void createNewInstance(CopletInstanceData coplet)
    throws ProcessingException {
        ProfileManager profileManager = null;
        try {
            profileManager =
                (ProfileManager) this.manager.lookup(ProfileManager.ROLE);

            CopletData copletData = coplet.getCopletData();

            LayoutFactory lfac =
                (LayoutFactory) this.manager.lookup(LayoutFactory.ROLE);

            CopletLayout copletLayout =
                (CopletLayout) lfac.newInstance("coplet");

            CopletFactory cfac =
                (CopletFactory) manager.lookup(CopletFactory.ROLE);

            CopletInstanceData newCoplet = cfac.newInstance(copletData);

            copletLayout.setCopletInstanceData(newCoplet);
            profileManager.register(copletLayout);

            NamedItem newItem = new NamedItem();
            newItem.setLayout(copletLayout);

            CompositeLayout tabLayout =
                (CompositeLayout) profileManager.getPortalLayout(
                    "portalApplications", null);

            newItem.setName(getNewInstanceTabName(tabLayout));
            tabLayout.addItem(newItem);
        } catch (ServiceException ce) {
View Full Code Here

Examples of org.apache.cocoon.portal.profile.ProfileManager

           
            PortalService service = null;
            EventManager eventManager = null;
            try {
                service = (PortalService)this.manager.lookup(PortalService.ROLE);               
                ProfileManager profileManager = service.getComponentManager().getProfileManager();
                if ( layout instanceof CopletLayout ) {
                    // full screen?
                    if ( layout.equals(service.getEntryLayout(null)) ) {
                        Event event = new FullScreenCopletEvent(((CopletLayout)layout).getCopletInstanceData(), null);
                        eventManager = (EventManager)this.manager.lookup(EventManager.ROLE);
                        eventManager.getPublisher().publish(event);
                        service.getComponentManager().getLinkService().addEventToLink(event);
                    }
                    CopletFactory factory = service.getComponentManager().getCopletFactory();
                    factory.remove( ((CopletLayout)layout).getCopletInstanceData());
                }
                profileManager.unregister(layout);
            } catch (ServiceException ce) {
                throw new ProcessingException("Unable to lookup portal service.", ce);
            } finally {
                this.manager.release( service );
                this.manager.release(eventManager);
View Full Code Here

Examples of org.apache.cocoon.portal.profile.ProfileManager

     * @param   coplet  the coplet instance data
     * @trows  ProcessingException if something fails in the creation process
     */
    private void createNewInstance(CopletInstanceData coplet)
        throws ProcessingException {
        ProfileManager profileManager = null;
        try {
            profileManager =
                (ProfileManager) this.manager.lookup(ProfileManager.ROLE);

            CopletData copletData = coplet.getCopletData();

            LayoutFactory lfac =
                (LayoutFactory) this.manager.lookup(LayoutFactory.ROLE);

            CopletLayout copletLayout =
                (CopletLayout) lfac.newInstance("coplet");

            CopletFactory cfac =
                (CopletFactory) manager.lookup(CopletFactory.ROLE);

            CopletInstanceData newCoplet = cfac.newInstance(copletData);

            copletLayout.setCopletInstanceData(newCoplet);
            profileManager.register(copletLayout);

            NamedItem newItem = new NamedItem();
            newItem.setLayout(copletLayout);

            CompositeLayout tabLayout =
                (CompositeLayout) profileManager.getPortalLayout(
                    "portalApplications", null);

            newItem.setName(getNewInstanceTabName(tabLayout));
            tabLayout.addItem(newItem);
        } catch (ServiceException ce) {
View Full Code Here

Examples of org.apache.cocoon.portal.profile.ProfileManager

                final Event saveEvent = new SaveBasketEvent();
                XMLUtils.data(this.xmlConsumer, linkService.getLinkURI(saveEvent));
                XMLUtils.endElement(this.xmlConsumer, "persist-url");
               
                if ( basket.size() > 0 ) {
                    ProfileManager profileManager = service.getComponentManager().getProfileManager();
                   
                    XMLUtils.startElement(this.xmlConsumer, "items");
                    for(int i=0; i<basket.size();i++) {
                        Object item = basket.getItem(i);
                        XMLUtils.startElement(this.xmlConsumer, "item");
                        XMLUtils.startElement(this.xmlConsumer, "id");
                        XMLUtils.data(this.xmlConsumer, item.toString());
                        XMLUtils.endElement(this.xmlConsumer, "id");
                        if ( item instanceof ContentItem ) {
                            ContentItem ci = (ContentItem)item;
                            Event e = new ShowItemEvent(item, profileManager.getPortalLayout(null, this.showLayoutId), this.showCopletId);
                            XMLUtils.startElement(this.xmlConsumer, "show-url");
                            XMLUtils.data(this.xmlConsumer, linkService.getLinkURI(e));
                            XMLUtils.endElement(this.xmlConsumer, "show-url");
                            if (ci.size() != -1 ) {
                                XMLUtils.startElement(this.xmlConsumer, "size");
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.