본 내용은 실전 OSGi&SpringDM(위키북스) 책의 Chapter 7의 일부 내용입니다
OSGi 콘솔 확장하기 (for Eclipse Equinox Developers)
OSGi 콘솔 확장하기 (for Eclipse Equinox Developers)
1. 인터페이스 추가
1.1 인터페이스
//org.eclipse.osgi.framework.console에 선언된 인터페이스
//Manifest의 Import-Package에 위의 인터페이스를 추가해 준다.
public interface CommandProvider {
//콘솔창에서 help를 입력할 때 나오는 문장열
public String getHelp();
}
1.2 구현체
//메소드 이름 앞에 “_”를 넣어줘야 자동으로 콘솔에 등록된다.
//inplements CommadProvider
public void _hello(CommandInterpreter ci) {
System.out.println(“Hello “ + ci.nextArgument());
}