DBA Data[Home] [Help]

PACKAGE: SYS.JVMRJBCINV

Source


1 package jvmrjbcinv authid current_user as
2 
3   function rjbc_sessid return VARCHAR2;
4   function rjbc_flags  return VARCHAR2;
5 
6   -- rjbc_init: setup back channel, return id that identifies it.  Called
7   -- prior to runjava in the same session as runjava will run in.
8   -- flags non zero means dont use back channel for file content
9   -- this corresponds to the ojvmjava runjava mode server_file_system
10   function rjbc_init(flags NUMBER) return VARCHAR2;
11 
12   -- rjbc_request: called from runjava to ask for contents or directoriness
13   -- of file identified by pathname on the client filesystem.  Puts pathname
14   -- in the java$jvm$rjbc row then waits for client response.  rtype 0 means
15   -- get content, 1 means ask if directory
16   -- status returned is 0 if content returned or is directory, !0 otherwise
17   -- lob returned if pathname found
18   function rjbc_request(pathname VARCHAR2, rtype NUMBER, lob out BLOB)
19     return NUMBER;
20 
21   -- rjbc_normalize: called from runjava to ask for the normalized, absolute
22   -- pathname on the client filesystem of the file identified by the input
23   -- argument pathname.  Puts pathname in the java$jvm$rjbc row then waits
24   ---for client response.
25   -- rtype is not used.
26   -- status returned is 0 if the file is a directory, non-zero otherwise.
27   -- This value is also not used.
28   -- normalized_pathname is returned containing the normalized path.
29   function rjbc_normalize(pathname VARCHAR2, rtype NUMBER,
30                           normalized_pathname out VARCHAR2)
31     return NUMBER;
32 
33   -- rjbc_output: set_output_to_sql entrypoint used by runjava to pass
34   -- output back to the client.
35   -- Puts text in the java$jvm$rjbc row then waits for client response.
36   procedure rjbc_output(text VARCHAR2, nl NUMBER);
37 
38   -- rjbc_done: called from client to shutdown back channel
39   procedure rjbc_done(id VARCHAR2 := null);
40 
41   -- back channel entrypoint
42   -- rjbc_respond. Called in loop by back channel client thread to respond
43   -- to requests queued by rjbc_request, rjbc_normalize and rjbc_output.
44   -- status argument indicates result of processing the previous request.
45   -- status values are: -1 = initial call (there was no previous request)
46   --                     0 = file content found and returned
47   --                     1 = file not found
48   -- p in argument receives the normalized path for an rjbc_normalize request
49   -- l in argument receives the lob containing the file content for an
50   -- rjbc_request request.
51   -- return values indicate the kind of the new request.  These values are:
52   --   -1 = no request (ie, time to exit)
53   --    0 = file content (rjbc_request)
54   --    1 = normalize path (rjbc_normalize)
55   --    2 = newline terminated output (rjbc_output)
56   --    3 = nonnewline terminated output (rjbc_output)
57   -- For return values 0 and 1, the p out argument contains the name of the
58   -- file to be processed.  For return values 2 and 3 p contains the text
59   -- to be output.
60   function rjbc_respond(sid VARCHAR2, status NUMBER, p in out VARCHAR2, l BLOB)
61     return NUMBER;
62 
63   -- The following functions are used by loadjava
64 
65   -- starts the actions of copying a file to the server.
66   -- b is used repeatedly to copy chuncks.
67   procedure deploy_open(filename varchar, b out BLOB)
68   as language java name
69   'oracle.aurora.server.tools.loadjava.Deploy.open(java.lang.String, oracle.sql.BLOB[])' ;
70 
71   -- copys a chunk out of the BLOB
72   procedure deploy_copy(b BLOB)
73   as language java name 'oracle.aurora.server.tools.loadjava.Deploy.copy(oracle.sql.BLOB)';
74 
75   -- invokes the a deployed class
76   function deploy_invoke(schema varchar, classname varchar) return varchar
77   as language java name 'oracle.aurora.server.tools.loadjava.Deploy.invoke(java.lang.String, java.lang.String) return java.lang.String' ;
78 
79   -- handleMd5 accesses information about schema objects that
80   -- is needed by loadjava
81   function handleMd5(s varchar2, name varchar2, type number) return raw
82   as language java name
83   'oracle.aurora.server.tools.loadjava.HandleMd5.get
84      (java.lang.String,java.lang.String,int) return oracle.sql.RAW';
85 
86   -- variant that looks in current schema
87   function handleMd5(name varchar2, type number) return raw
88   as language java name
89   'oracle.aurora.server.tools.loadjava.HandleMd5.get
90      (java.lang.String,int) return oracle.sql.RAW';
91 
92   -- jar loading
93   function start_loading_jar(name    varchar2,
94                              schema  varchar2,
95                              path    varchar2,
96                              flags   number,
97                              content blob,
98                              msg out varchar2) return number
99   as language java name
100   'oracle.aurora.rdbms.DbmsJava.startLoadingJar
101      (java.lang.String,
102       java.lang.String,
103       java.lang.String,
104       int,
105       oracle.sql.BLOB,
106       java.lang.String[])
107    return int';
108 
109   function finish_loading_jar(flags   number,
110                               msg out varchar2) return number
111   as language java name
112   'oracle.aurora.rdbms.DbmsJava.finishLoadingJar
113      (int,
114       java.lang.String[])
115    return int';
116 
117   function jar_status(name    varchar2,
118                       schema  varchar2,
119                       msg out varchar2) return number
120   as language java name
121   'oracle.aurora.rdbms.DbmsJava.jarStatus
122      (java.lang.String,
123       java.lang.String,
124       java.lang.String[])
125    return int';
126 
127   function drop_jar(name    varchar2,
128                     schema  varchar2,
129                     msg out varchar2) return number
130   as language java name
131   'oracle.aurora.rdbms.DbmsJava.dropJar
132      (java.lang.String,
133       java.lang.String,
134       java.lang.String[])
135    return int';
136 
137 end jvmrjbcinv;