30 lines
591 B
Plaintext
30 lines
591 B
Plaintext
The ``++@Remote++`` annotation indicates that an interface may be called from a remote client. Therefore the parameters and return types of methods in the interface must be ``++Serializable++``.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
----
|
|
public class Employee { // Nonserializable
|
|
}
|
|
|
|
@Remote
|
|
public interface EmployeeServiceRemote {
|
|
public Employee getEmployee(String id); // Noncompliant
|
|
}
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
----
|
|
public class Employee implements Serializable{
|
|
}
|
|
|
|
@Remote
|
|
public interface EmployeeServiceRemote {
|
|
public Employee getEmployee(String id); // Noncompliant
|
|
}
|
|
----
|
|
|
|
|