Author: peter_firmstone Date: Mon Feb 7 04:36:39 2011 New Revision: 1067855
URL: http://svn.apache.org/viewvc?rev=1067855&view=rev Log: Added DefaultEntries utility builder suggested by Dan. Added: incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/DefaultEntries.java (with props) Added: incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/DefaultEntries.java URL: http://svn.apache.org/viewvc/incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/DefaultEntries.java?rev=1067855&view=auto ============================================================================== --- incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/DefaultEntries.java (added) +++ incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/DefaultEntries.java Mon Feb 7 04:36:39 2011 @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.river.api.lookup; + +import java.util.HashSet; +import java.util.Set; +import net.jini.lookup.entry.Address; +import net.jini.lookup.entry.Comment; +import net.jini.lookup.entry.Location; +import net.jini.lookup.entry.Name; +import net.jini.lookup.entry.ServiceInfo; +import net.jini.lookup.entry.Status; +import net.jini.lookup.entry.UIDescriptor; + +/** + * A little builder utility class that creates an array of Entry classes to + * be used as a parameter for StreamServiceRegistrar. All the jini platform + * Entry's are included by default. + * + * Suggested by Dan Creswell. + * @author peter + */ +public class DefaultEntries { + private final Set<Class> entrys; + public DefaultEntries() { + entrys = new HashSet<Class>(16); + add(Comment.class); + add(Location.class); + add(Name.class); + add(ServiceInfo.class); + add(Status.class); + add(UIDescriptor.class); + add(Address.class); + } + public DefaultEntries add(Class cl){ + entrys.add(cl); + return this; + } + public Class[] getEntries(){ + return entrys.toArray(new Class[entrys.size()]); + } + +} Propchange: incubator/river/jtsk/skunk/pepe/src/org/apache/river/api/lookup/DefaultEntries.java ------------------------------------------------------------------------------ svn:eol-style = native
