delay = ((NumericValue)args[1].itemAt(0)).getLong();
delay = ((NumericValue)args[2].itemAt(0)).getLong();
	public Sequence eval(Sequence[] args, Sequence contextSequence) throws XPathException	{		String username = args[0].getStringValue();		String password = args[1].getStringValue();		long delay = 0;		if(args.length == 3)		{			if(!args[2].isEmpty())			{				delay = ((NumericValue)args[1].itemAt(0)).getLong();			}		}				try		{			//get the root collection			Collection root = DatabaseManager.getCollection("xmldb:exist://" + DBBroker.ROOT_COLLECTION, username, password);						DatabaseInstanceManager mgr = (DatabaseInstanceManager) root.getService("DatabaseInstanceManager", "1.0");						//get the database instance manager			if(mgr == null)			{				System.err.println("service is not available");			}			else if(mgr.isLocalInstance())			{				System.out.println("shutting down database...");				if(delay == 0)				{					mgr.shutdown();				}				else				{					mgr.shutdown(delay);				}			}						return Sequence.EMPTY_SEQUENCE;		}		catch(XMLDBException xmldbe)		{			throw new XPathException(getASTNode(), "Exception while retrieving root collection: " + xmldbe.getMessage(), xmldbe);		}			}