if( args.length > 1 && args[ 1 ] != null ) {
Integer i = (Integer) args[ 1 ];
maxReturn = i.intValue();
}
ServiceObject s = null;
if( args.length > 2 ) {
s = (ServiceObject) args[ 2 ];
}
Store store = null;
ServiceConfiguration serviceConfig = null;
if( s == null ) {
store = Session.getDefaultInstance().getStore();
serviceConfig = store.getServiceConfiguration();
} else {
try {
serviceConfig = new ServiceConfiguration( s.getUid(), s.getCid() );
} catch( NoSuchServiceException e ) {
serviceConfig = null;
} finally {
if( serviceConfig != null ) {
store = Session.getInstance( serviceConfig ).getStore();