KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > system > properties > NamingProperties


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.geronimo.system.properties;
18
19 import org.apache.geronimo.gbean.GBeanInfo;
20 import org.apache.geronimo.gbean.GBeanInfoBuilder;
21
22 /** java.naming.factory.initial=com.sun.jndi.rmi.registry.RegistryContextFactory
23 java.naming.factory.url.pkgs=org.apache.geronimo.naming
24 java.naming.provider.url=rmi://localhost:1099
25
26  */

27 public class NamingProperties {
28
29     static final String JavaDoc JAVA_NAMING_FACTORY_INITIAL = "java.naming.factory.initial";
30     static final String JavaDoc JAVA_NAMING_FACTORY_URL_PKGS = "java.naming.factory.url.pkgs";
31     static final String JavaDoc JAVA_NAMING_PROVIDER_URL = "java.naming.provider.url";
32
33     public NamingProperties(String JavaDoc namingFactoryInitial, String JavaDoc namingFactoryUrlPkgs, String JavaDoc namingProviderUrl) {
34         setNamingFactoryInitial(namingFactoryInitial);
35         setNamingFactoryUrlPkgs(namingFactoryUrlPkgs);
36         setNamingProviderUrl(namingProviderUrl);
37     }
38
39     public String JavaDoc getNamingFactoryInitial() {
40         return System.getProperty(JAVA_NAMING_FACTORY_INITIAL);
41     }
42
43     public void setNamingFactoryInitial(String JavaDoc namingFactoryInitial) {
44         System.setProperty(JAVA_NAMING_FACTORY_INITIAL, namingFactoryInitial);
45     }
46
47     public String JavaDoc getNamingFactoryUrlPkgs() {
48         return System.getProperty(JAVA_NAMING_FACTORY_URL_PKGS);
49     }
50
51     public void setNamingFactoryUrlPkgs(String JavaDoc namingFactoryUrlPkgs) {
52         System.setProperty(JAVA_NAMING_FACTORY_URL_PKGS, namingFactoryUrlPkgs);
53     }
54
55     public String JavaDoc getNamingProviderUrl() {
56         return System.getProperty(JAVA_NAMING_PROVIDER_URL);
57     }
58
59     public void setNamingProviderUrl(String JavaDoc namingProviderUrl) {
60         System.setProperty(JAVA_NAMING_PROVIDER_URL, namingProviderUrl);
61     }
62
63     public static final GBeanInfo gbeanInfo;
64
65     static {
66         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(NamingProperties.class);
67         infoFactory.addAttribute("namingFactoryInitial", String JavaDoc.class, true);
68         infoFactory.addAttribute("namingFactoryUrlPkgs", String JavaDoc.class, true);
69         infoFactory.addAttribute("namingProviderUrl", String JavaDoc.class, true, true);
70
71         infoFactory.setConstructor(new String JavaDoc[] {"namingFactoryInitial", "namingFactoryUrlPkgs", "namingProviderUrl"});
72
73         gbeanInfo = infoFactory.getBeanInfo();
74     }
75
76     public static GBeanInfo getGBeanInfo() {
77         return gbeanInfo;
78     }
79 }
80
Popular Tags