View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership. The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License. You may obtain a copy of the License at
9    * 
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   * 
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  
19  package org.apache.river.phoenix.common;
20  
21  import java.io.IOException;
22  import java.io.Serializable;
23  import org.apache.river.api.io.AtomicSerial;
24  import org.apache.river.api.io.AtomicSerial.GetArg;
25  
26  /**
27   * Initialization data for <code> ActivationGroupImpl</code>, to control the
28   * activation group's configuration. An instance of this is specified
29   * in the <code>ActivationGroupDesc</code> for the group.
30   *
31   * @author Sun Microsystems, Inc.
32   * 
33   * @since 2.0
34   */
35  @AtomicSerial
36  public class ActivationGroupData implements Serializable {
37      private static final long serialVersionUID = 1135616886784731068L;
38  
39      /**
40       * The configuration options.
41       *
42       * @serial
43       */
44      private final String[] config;
45  
46      /**
47       * Constructs an instance with the specified
48       * {@link net.jini.config.Configuration} options, if any.
49       *
50       * @param config the configuration options, or <code>null</code>
51       */
52      public ActivationGroupData(String[] config) {
53  	this.config = (config == null ? null : (String[]) config.clone());
54      }
55      
56      ActivationGroupData(GetArg arg) throws IOException{
57  	this(arg.get("config", null, String[].class));
58      }
59  
60      /**
61       * Returns the configuration options, or <code>null</code>.
62       *
63       * @return the configuration options, or <code>null</code>
64       */
65      public String[] getConfig() {
66  	return config == null ? null : (String[]) config.clone();
67      }
68  }