i am facing one problem.i have a class named "ReportingService" and it should be singleton and is is extending "CommonService".
package MyApp.Services.ReportingService;
public class ReportingService extends CommonService {
private static ReportingService instance = null;
public static ReportingService getInstance() {
if (instance == null) {
instance = new ReportingService();
}
return instance;
}
}
and to access this class in other class i am using
package MyApp.Services.WebReportingService;
@WebMethod(operationName = "registerUDP")
public boolean registerUDP(
@WebParam(name = "Friendly Name") String friendlyName,
@WebParam(name = "Username") String username,
@WebParam(name = "Password") String password,
@WebParam(name = "Communication Protocol") CommunicationProtocol communicationProtocol,
@WebParam(name = "IP Address") String ipAddress,
@WebParam(name = "Port") int port) {
Consumer client = new Consumer(friendlyName, username, password, communicationProtocol, ipAddress, port);
ReportingService rs = ReportingService.
return true;
}
in "ReportingService rs = ReportingService." it is not showing me getInstance() method of ReportingService class. I also imported correct packages.
NOTE: both classes are in different packages.