de.smartics.properties.spi.config.ds
Class DsPropertyCollection

Package class diagram package DsPropertyCollection
java.lang.Object
  extended by de.smartics.properties.spi.config.ds.DsPropertyCollection
All Implemented Interfaces:
PropertyCollection, Iterable< Property>

@NotThreadSafe
public final class DsPropertyCollection
     
     
extends Object
implements PropertyCollection

Implementation of PropertyCollection based on accessing a data source.


Constructor Summary
DsPropertyCollection(String dataSourceId, Connection connection, ResultSet resultSet)
          Default constructor.
 
Method Summary
 void close()
          Closes the collection to release the underlying connection.
 Iterator<Property> iterator()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DsPropertyCollection

public DsPropertyCollection(String dataSourceId,
                            Connection connection,
                            ResultSet resultSet)
Default constructor.

Parameters:
dataSourceId - the identifier of the data source the properties are read from.
connection - the underlying connection of the result set.
resultSet - the properties to iterate over.
Method Detail

iterator

public Iterator<Property> iterator()

Specified by:
iterator in interface Iterable<Property>
See Also:
Iterable.iterator()

close

public void close()
Closes the collection to release the underlying connection.

The connection is automatically closed when the iterator reaches the last element.



Copyright © 2012-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.