Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dCache
nfs4j
Commits
7788c500
Commit
7788c500
authored
Sep 25, 2011
by
Tigran Mkrtchyan
☕
Browse files
build: remove rpc code and use it as maven dependency
parent
2f133931
Changes
98
Hide whitespace changes
Inline
Side-by-side
pom.xml
View file @
7788c500
...
...
@@ -201,11 +201,6 @@
EXTERNAL DEPENDENCIES
-->
<dependencies>
<dependency>
<groupId>
com.sun.grizzly
</groupId>
<artifactId>
grizzly-framework
</artifactId>
<version>
1.9.19
</version>
</dependency>
<dependency>
<groupId>
com.jolbox
</groupId>
<artifactId>
bonecp
</artifactId>
...
...
@@ -257,6 +252,11 @@
<artifactId>
liquibase-core
</artifactId>
<version>
2.0.1
</version>
</dependency>
<dependency>
<groupId>
org.dcache
</groupId>
<artifactId>
nio-jrpc
</artifactId>
<version>
0.0.1-SNAPSHOT
</version>
</dependency>
<!--
LOCAL JARS
-->
...
...
@@ -265,16 +265,6 @@
<artifactId>
chimera-core
</artifactId>
<version>
0.0.12-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
org.dcache.common
</groupId>
<artifactId>
dcache-auth
</artifactId>
<version>
0.0.10-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.sun.jna
</groupId>
<artifactId>
jna
</artifactId>
<version>
3.0.9
</version>
</dependency>
</dependencies>
<!--
...
...
src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenConst.java
deleted
100644 → 0
View file @
2f133931
/*
* $Header: /cvsroot/remotetea/remotetea/src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenConst.java,v 1.1.1.1 2003/08/13 12:03:45 haraldalbrecht Exp $
*
* Copyright (c) 1999, 2000
* Lehrstuhl fuer Prozessleittechnik (PLT), RWTH Aachen
* D-52064 Aachen, Germany.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This library 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program (see the file COPYING.LIB for more
* details); if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package
org.acplt.oncrpc.apps.jrpcgen
;
/**
* The <code>JrpcgenConst</code> class represents a single constant defined
* in an rpcgen "x"-file.
*
* @version $Revision: 1.1.1.1 $ $Date: 2003/08/13 12:03:45 $ $State: Exp $ $Locker: $
* @author Harald Albrecht
*/
public
class
JrpcgenConst
{
/**
* Constant identifier.
*/
public
String
identifier
;
/**
* Contains value (or identifier refering to another constant) of constant.
*/
public
String
value
;
/**
* Specifies the enclosure (scope) within the identifier must be
* addressed for a constant defined by an enumumeration.
*/
public
String
enclosure
;
/**
* Returns value as integer literal (and thus resolving identifiers
* recursively, if necessary). This is only possible for simple
* subsitutions, that is A is defined as B, B as C, and C as 42, thus
* A is eventually defined as 42.
*
* <p>This simple kind of resolving is necessary when defining a particular
* version of an ONC/RPC protocol. We need to be able to resolve the
* version to an integer literal because we need to append the version
* number to any remote procedure defined to avoid identifier clashes if
* the same remote procedure is defined for several versions.
*
* @return integer literal as <code>String</code> or <code>null</code>,
* if the identifier could not be resolved to an integer literal.
*/
public
String
resolveValue
()
{
if
(
value
.
length
()
>
0
)
{
//
// If the value is an integer literal, then we just have to
// return it. That's it.
//
if
(
Character
.
isDigit
(
value
.
charAt
(
0
))
||
(
value
.
charAt
(
0
)
==
'-'
)
)
{
return
value
;
}
//
// It's an identifier, which we now have to resolve. First,
// look it up in the list of global identifiers. Then recursively
// resolve the value.
//
Object
id
=
jrpcgen
.
globalIdentifiers
.
get
(
identifier
);
if
(
(
id
!=
null
)
&&
(
id
instanceof
JrpcgenConst
)
)
{
return
((
JrpcgenConst
)
id
).
resolveValue
();
}
}
return
null
;
}
/**
* Constructs a <code>JrpcgenConst</code> and sets the identifier and
* the associated value.
*
* @param identifier Constant identifier to define.
* @param value Value assigned to constant.
*/
public
JrpcgenConst
(
String
identifier
,
String
value
)
{
this
(
identifier
,
value
,
null
);
}
/**
* Constructs a <code>JrpcgenConst</code> and sets the identifier and
* the associated value of an enumeration etc.
*
* @param identifier Constant identifier to define.
* @param value Value assigned to constant.
* @param enclosure Name of enclosing enumeration, etc.
*/
public
JrpcgenConst
(
String
identifier
,
String
value
,
String
enclosure
)
{
this
.
identifier
=
identifier
;
this
.
value
=
value
;
this
.
enclosure
=
enclosure
;
}
/**
* Returns the identifier this constant depends on or <code>null</code>,
* if no dependency exists.
*
* @return dependency identifier or <code>null</code>.
*/
public
String
getDependencyIdentifier
()
{
int
len
=
value
.
length
();
int
idx
=
0
;
char
c
;
//
// Check to see if it's an identifier and search for its end.
// This is necessary as elements of an enumeration might have
// "+x" appended, where x is an integer literal.
//
while
(
idx
<
len
)
{
c
=
value
.
charAt
(
idx
++);
if
(
!(
((
c
>=
'A'
)
&&
(
c
<=
'Z'
))
||
((
c
>=
'a'
)
&&
(
c
<=
'z'
))
||
(
c
==
'_'
)
||
((
c
>=
'0'
)
&&
(
c
<=
'9'
)
&&
(
idx
>
0
))
)
)
{
--
idx
;
// back up to the char not belonging to the identifier.
break
;
}
}
if
(
idx
>
0
)
{
return
value
.
substring
(
0
,
idx
);
}
return
null
;
}
/**
* Dumps the constant as well as its value to <code>System.out</code>.
*/
public
void
dump
()
{
System
.
out
.
println
(
identifier
+
" = "
+
value
);
}
/**
* Flag indicating whether this constant and its dependencies should be
* traversed any more.
*/
public
boolean
dontTraverseAnyMore
=
false
;
}
// End of JrpcgenConst.java
src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenDeclaration.java
deleted
100644 → 0
View file @
2f133931
/*
* $Header: /cvsroot/remotetea/remotetea/src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenDeclaration.java,v 1.2 2003/08/14 08:08:34 haraldalbrecht Exp $
*
* Copyright (c) 1999, 2000
* Lehrstuhl fuer Prozessleittechnik (PLT), RWTH Aachen
* D-52064 Aachen, Germany.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This library 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program (see the file COPYING.LIB for more
* details); if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package
org.acplt.oncrpc.apps.jrpcgen
;
/**
* The <code>JrpcgenDeclaration</code> class represents a single declaration
* from an rpcgen "x"-file.
*
* @version $Revision: 1.2 $ $Date: 2003/08/14 08:08:34 $ $State: Exp $ $Locker: $
* @author Harald Albrecht
*/
public
class
JrpcgenDeclaration
implements
Cloneable
{
/**
* Identifier.
*/
public
String
identifier
;
/**
* Type specifier.
*/
public
String
type
;
/**
* Kind of declaration (scalar, fixed size vector, dynamic vector).
*
* @see JrpcgenDeclaration#SCALAR
* @see JrpcgenDeclaration#FIXEDVECTOR
* @see JrpcgenDeclaration#DYNAMICVECTOR
* @see JrpcgenDeclaration#INDIRECTION
*/
public
int
kind
;
/**
* Fixed size or upper limit for size of vector.
*/
public
String
size
;
/**
* Indicates that a scalar is declared.
*/
public
static
final
int
SCALAR
=
0
;
/**
* Indicates that a vector (an array) with fixed size is declared.
*/
public
static
final
int
FIXEDVECTOR
=
1
;
/**
* Indicates that a vector (an array) with dynamic (or unknown) size
* is declared.
*/
public
static
final
int
DYNAMICVECTOR
=
2
;
/**
* Indicates that an indirection (reference, pointer, whatever you like
* to call it nowadays) is declared.
*/
public
static
final
int
INDIRECTION
=
3
;
/**
* Returns the identifier.
*/
public
String
toString
()
{
return
identifier
;
}
/**
* Constructs a <code>JrpcgenDeclaration</code> and sets the identifier
* and its data type. The {@link JrpcgenDeclaration#kind} of the
* declaration is assumed to be {@link JrpcgenDeclaration#SCALAR}.
*
* @param identifier Identifier to be declared.
* @param type Data type the identifier is declared of.
*/
public
JrpcgenDeclaration
(
String
identifier
,
String
type
)
{
this
.
identifier
=
identifier
;
this
.
type
=
type
;
this
.
kind
=
SCALAR
;
}
/**
* Constructs a <code>JrpcgenDeclaration</code> and sets the identifier,
* its data type, kind and size of vector. This constructur is typically
* used when declaring either fixed-size or dynamic arrays.
*
* @param identifier Identifier to be declared.
* @param type Data type the identifier is declared of.
* @param kind Kind of declaration (scalar, vector, indirection).
* @param size Size of array (if fixed-sized, otherwise <code>null</code>).
*/
public
JrpcgenDeclaration
(
String
identifier
,
String
type
,
int
kind
,
String
size
)
{
this
.
identifier
=
identifier
;
this
.
type
=
type
;
this
.
kind
=
kind
;
this
.
size
=
size
;
}
/**
* Dumps the declaration to <code>System.out</code>.
*/
public
void
dump
()
{
System
.
out
.
print
(
type
);
System
.
out
.
print
(
kind
==
JrpcgenDeclaration
.
INDIRECTION
?
" *"
:
" "
);
System
.
out
.
print
(
identifier
);
switch
(
kind
)
{
case
JrpcgenDeclaration
.
FIXEDVECTOR
:
System
.
out
.
print
(
"["
+
size
+
"]"
);
break
;
case
JrpcgenDeclaration
.
DYNAMICVECTOR
:
if
(
size
!=
null
)
{
System
.
out
.
print
(
"<"
+
size
+
">"
);
}
else
{
System
.
out
.
print
(
"<>"
);
}
break
;
}
System
.
out
.
println
();
}
/**
* Clones declaration object.
*/
public
Object
clone
()
throws
CloneNotSupportedException
{
return
super
.
clone
();
}
}
// End of JrpcgenDeclaration.java
\ No newline at end of file
src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenEnum.java
deleted
100644 → 0
View file @
2f133931
/*
* $Header: /cvsroot/remotetea/remotetea/src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenEnum.java,v 1.1.1.1 2003/08/13 12:03:45 haraldalbrecht Exp $
*
* Copyright (c) 1999, 2000
* Lehrstuhl fuer Prozessleittechnik (PLT), RWTH Aachen
* D-52064 Aachen, Germany.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This library 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program (see the file COPYING.LIB for more
* details); if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package
org.acplt.oncrpc.apps.jrpcgen
;
import
java.util.Vector
;
/**
* The <code>JrpcgenEnum</code> class represents a single enumeration
* from an rpcgen "x"-file. It is a "container" for the elements (constants)
* belonging to this enumeration.
*
* @version $Revision: 1.1.1.1 $ $Date: 2003/08/13 12:03:45 $ $State: Exp $ $Locker: $
* @author Harald Albrecht
*/
public
class
JrpcgenEnum
{
/**
* Enumeration identifier.
*/
public
String
identifier
;
/**
* Contains enumeration elements as well as their values. The elements
* are of class {@link JrpcgenConst}.
*/
public
Vector
enums
;
/**
* Returns the fully qualified identifier.
*
* return fully qualified identifier.
*/
public
String
toString
()
{
return
identifier
;
}
/**
* Constructs a <code>JrpcgenEnum</code> and sets the identifier and all
* its enumeration elements.
*
* @param identifier Identifier to be declared.
* @param enums Vector of enumeration elements of class {@link JrpcgenConst}.
*/
public
JrpcgenEnum
(
String
identifier
,
Vector
enums
)
{
this
.
identifier
=
identifier
;
this
.
enums
=
enums
;
}
/**
* Dumps the enumeration together with its elements to
* <code>System.out</code>.
*/
public
void
dump
()
{
System
.
out
.
println
(
"ENUM "
+
identifier
);
int
size
=
enums
.
size
();
for
(
int
idx
=
0
;
idx
<
size
;
++
idx
)
{
JrpcgenConst
c
=
(
JrpcgenConst
)
enums
.
elementAt
(
idx
);
System
.
out
.
print
(
" "
);
c
.
dump
();
}
System
.
out
.
println
();
}
}
// End of JrpcgenEnum.java
src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenParamInfo.java
deleted
100644 → 0
View file @
2f133931
/*
* $Header: /cvsroot/remotetea/remotetea/src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenParamInfo.java,v 1.2 2003/08/14 08:09:59 haraldalbrecht Exp $
*
* Copyright (c) 1999, 2000
* Lehrstuhl fuer Prozessleittechnik (PLT), RWTH Aachen
* D-52064 Aachen, Germany.
* All rights reserved.
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This library 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 Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this program (see the file COPYING.LIB for more
* details); if not, write to the Free Software Foundation, Inc.,
* 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package
org.acplt.oncrpc.apps.jrpcgen
;
/**
* The <code>JrpcgenParamInfo</code> class contains information about the
* data type of a procedure's parameter, as well as the parameter's optional
* name.
*
* @version $Revision: 1.2 $ $Date: 2003/08/14 08:09:59 $ $State: Exp $ $Locker: $
* @author Harald Albrecht
*/
class
JrpcgenParamInfo
{
/**
*
*/
public
String
parameterType
;
/**
*
*/
public
String
parameterName
;
/**
* Constructs a new <code>JrpcgenParamInfo</code> object containing
* information about ...
*
*/
public
JrpcgenParamInfo
(
String
parameterType
,
String
parameterName
)
{
this
.
parameterType
=
parameterType
;
this
.
parameterName
=
parameterName
;
}
}
// End of JrpcgenParamInfo.java
\ No newline at end of file
src/org/acplt/oncrpc/apps/jrpcgen/JrpcgenParser.cup
deleted
100644 → 0
View file @
2f133931
/*
*
$
Header
:
/
cvsroot
/
remotetea
/
remotetea
/
src
/
org
/
acplt
/
oncrpc
/
apps
/
jrpcgen
/
JrpcgenParser
.
cup
,
v
1.2
2005
/
11
/
11
21
:
29
:
44
haraldalbrecht
Exp
$
*
*
Copyright
(
c
)
1999
,
2000
*
Lehrstuhl
fuer
Prozessleittechnik
(
PLT
),
RWTH
Aachen
*
D
-
52064
Aachen
,
Germany
.
*
All
rights
reserved
.
*
*
This
library
is
free
software
;
you
can
redistribute
it
and
/
or
modify
*
it
under
the
terms
of
the
GNU
Library
General
Public
License
as
*
published
by
the
Free
Software
Foundation
;
either
version
2
of
the
*
License
,
or
(
at
your
option
)
any
later
version
.
*
*
This
library
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
Library
General
Public
License
for
more
details
.
*
*
You
should
have
received
a
copy
of
the
GNU
Library
General
Public
*
License
along
with
this
program
(
see
the
file
COPYING
.
LIB
for
more
*
details
);
if
not
,
write
to
the
Free
Software
Foundation
,
Inc
.,
*
675
Mass
Ave
,
Cambridge
,
MA
02139
,
USA
.
*/
/*
*
To
compile
into
java
code
use
:
*
java
java_cup
.
Main
-
interface
\
*
-
runtime
org
.
acplt
.
oncrpc
.
apps
.
jrpcgen
.
cup_runtime
\
*
-
symbols
JrpcgenSymbols
-
parser
JrpcgenParser
<
JrpcgenParser
.
cup
*/
package
org
.
acplt
.
oncrpc
.
apps
.
jrpcgen
;
import
org
.
acplt
.
oncrpc
.
apps
.
jrpcgen
.
cup_runtime
.*;
import
java
.
util
.
Vector
;
//
//
We
need
to
set
up
some
code
within
the
parser
class
...
//
parser
code
{:
public
void
report_error
(
String
message
,
Object
info
)
{
StringBuffer
msg
=
new
StringBuffer
(
"jrpcgen: error"
);
if
(
info
instanceof
Symbol
)
{
Symbol
s
=
(
Symbol
)
info
;
msg
.
append
(
" in line "
);
msg
.
append
(
s
.
left
);
}
msg
.
append
(
": "
);
msg
.
append
(
message
);
System
.
out
.
println
(
msg
);
throw
(
new
JrpcgenParserException
());
}
public
void
report_error
(
String
message
,
int
line
)
{
StringBuffer
msg
=
new
StringBuffer
(
"jrpcgen: error in line "
);
msg
.
append
(
line
);
msg
.
append
(
": "
);
msg
.
append
(
message
);
System
.
out
.
println
(
msg
);
throw
(
new
JrpcgenParserException
());
}
public
void
syntax_error
(
Symbol
cur_token
)
{
StringBuffer
msg
=
new
StringBuffer
(
"jrpcgen: syntax error in line "
);
msg
.
append
(
cur_token
.
left
);
System
.
out
.
println
(
msg
);
throw
(
new
JrpcgenParserException
());
}
public
void
report_fatal_error
(
String
message
,
Object
info
)
{
report_error
(
message
,
info
);
throw
(
new
RuntimeException
(
"Fatal Syntax Error"
));
}
:};
//
//
As
per
convention
,
we
use
all
uppercase
letters
for
TERMINALs
.
//
Notes
:
//
-
we
do
not
define
the
terminals
U_SHORT
etc
.
but
instead
map
these
//
terminals
in
the
scanner
to
the
corresponding
signed
base
data
type
.
//
terminal
SEMICOLON
;
//
";"
terminal
COMMA
;
//
","
terminal
COLON
;
//
":"
terminal
EQUAL
;
//
"="
terminal
STAR
;
//
"*"
terminal
LPAREN
,
RPAREN
;
//
"("
")"
terminal
LBRACE
,
RBRACE
;
//
"{"
"}"
terminal
LBRACKET
,
RBRACKET
;
//
"["
"]"
terminal
LANGLE
,
RANGLE
;
//
"<"
">"
terminal
PROGRAM
;
//
"PROGRAM"
"program"