01: /*
02: * @(#)init.java 1.1 05/06/14
03: *
04: * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
05: *
06: * See the file "LICENSE.txt" for information on usage and redistribution
07: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
08: */
09: package pnuts.net;
10:
11: import pnuts.lang.Context;
12: import pnuts.lang.Package;
13: import pnuts.ext.ModuleBase;
14: import org.pnuts.net.*;
15:
16: /**
17: * Initialization of the pnuts.lib module.
18: */
19: public class init extends ModuleBase {
20:
21: static String[] files = { "pnuts/net/inet" };
22:
23: static String[][] functions = { { "isLocalHost" } };
24:
25: static String[] javaFunctions = { "getLocalHost", "getInetAddress",
26: "decodeURL", "encodeURL", "makeQueryString" };
27:
28: protected String getPrefix() {
29: return "org";
30: }
31:
32: public Object execute(Context context) {
33: context.clearPackages();
34: for (int i = 0; i < files.length; i++) {
35: autoload(functions[i], files[i], context);
36: }
37: for (int i = 0; i < javaFunctions.length; i++) {
38: autoloadFunction(javaFunctions[i], context);
39: }
40: return null;
41: }
42: }
|