2 Replies Latest reply on Feb 6, 2007 2:00 PM by Charles Crouch

    ProfileService.getRunningProfileName() ?

    Charles Crouch Expert

      So we need an api to return the name of the profile which is currently running on the server. In the current tests we just hardcode it to default:

      InitialContext ctx = super.getInitialContext();
      ProfileService ps = (ProfileService) ctx.lookup("ProfileService");
      activeView = ps.getViewManager();
      ProfileKey defaultKey = new ProfileKey("default");
      activeView.loadProfile(defaultKey);


      What about:

      String ProfileService.getRunningProfileName()


      This would return "default", "all" depending upon how the server was started. In the future if you're accessing the ProfileService while the server was not running this would just return null.

      Thoughts?


        • 1. Re: ProfileService.getRunningProfileName() ?
          Scott Stark Master

          That is not hard-coded, its saying to use the profile "default" as defined by the ProfileKey.

          You can edit any profile, not just the running one. There won't alway be an active profile as you can run the the profile service in a minimal kernel to edit a profile repository without an active jboss server instance.

          I can see a need to obtain the current profile when the profile service is running in the server. This method should really return the active ProfileKey.

          • 2. Re: ProfileService.getRunningProfileName() ?
            Charles Crouch Expert

             

            "scott.stark@jboss.org" wrote:
            That is not hard-coded, its saying to use the profile "default" as defined by the ProfileKey.

            You can edit any profile, not just the running one. There won't alway be an active profile as you can run the the profile service in a minimal kernel to edit a profile repository without an active jboss server instance.

            Right, understood.

            "scott.stark@jboss.org" wrote:

            I can see a need to obtain the current profile when the profile service is running in the server. This method should really return the active ProfileKey.


            I could also see the need to return the active ProfileKey even when the profile service is running in a different kernel, i.e. remote access to a running server.