/* Skandium: A Java(TM) based parallel skeleton library.
*
* Copyright (C) 2009 NIC Labs, Universidad de Chile.
*
* Skandium is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Skandium is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with Skandium. If not, see
The type of skeleton program's input.
* @param Stream newStream(Skeleton skeleton){
if(skeleton == null) throw new IllegalArgumentException("The specified skeleton cannot be null");
return new Stream (skeleton, executor);
}
/**
* This method shuts down the Skandium instance by shutting down the {@link java.util.concurrent.ExecutorService}.
*/
public void shutdown(){
executor.shutdown();
}
/**
* @return The default singleton instance of Skandium.
*/
public synchronized static Skandium getSingleton() {
//BUG: non essendo stato salvato, si trovava sempre il singleton a Null
if(singleton == null || singleton.executor.isShutdown()){
singleton = new Skandium();
}
return singleton;
}
public static String version(){
return "1.0b2";
}
}