1 22 package org.jboss.system.server.profileservice; 23 24 import java.io.IOException ; 25 26 import org.jboss.deployers.spi.management.ManagementView; 27 import org.jboss.profileservice.spi.NoSuchProfileException; 28 import org.jboss.profileservice.spi.Profile; 29 import org.jboss.profileservice.spi.ProfileKey; 30 import org.jboss.profileservice.spi.ProfileService; 31 import org.jboss.system.server.profile.basic.ProfileImpl; 32 33 34 40 public class ProfileServiceImpl 41 implements ProfileService 42 { 43 private String name; 44 private String profileRoot; 45 private Profile defaultImpl; 46 private ManagementView mgtView; 47 48 public ProfileServiceImpl(String name) throws IOException 49 { 50 this.name = name; 51 mgtView = new ManagementViewImpl(this); 52 } 53 55 public String getName() 56 { 57 return this.name; 58 } 59 public void setName(String name) 60 { 61 this.name = name; 62 } 63 public String getProfileRoot() 64 { 65 return this.profileRoot; 66 } 67 public void setProfileRoot(String profileRoot) 68 { 69 this.profileRoot = profileRoot; 70 } 71 72 public void start() 73 { 74 defaultImpl = new ProfileImpl(profileRoot, name); 75 } 76 77 public String [] getDomains() 79 { 80 String [] domains = {ProfileKey.DEFAULT}; 81 return domains; 82 } 83 84 public ProfileKey[] getProfileKeys() 85 { 86 ProfileKey[] keys = {new ProfileKey(null)}; 87 return keys; 88 } 89 90 93 public Profile getProfile(ProfileKey key) 94 throws NoSuchProfileException 95 { 96 return defaultImpl; 97 } 98 99 public String [] getProfileDeploymentNames(ProfileKey key) 100 throws NoSuchProfileException 101 { 102 String [] names = {"default"}; 103 return names; 104 } 105 106 public ManagementView getViewManager() 107 { 108 return mgtView; 109 } 110 public void setViewManager(ManagementView mgtView) 111 { 112 this.mgtView = mgtView; 113 } 114 115 public Profile newProfile(ProfileKey key) 117 { 118 return new ProfileImpl(profileRoot, name); 119 } 120 121 public void removeProfile(ProfileKey key) 122 throws NoSuchProfileException 123 { 124 } 125 } 126 127 | Popular Tags |