밑에 스프링 사이트에서 jar파일 및 Dependency를 찾을수있습니다.
http://www.springsource.com/repository/app/;jsessionid=A431F38984691BE6F71E5849F17C46E0.jvm1
또한 이곳에서도 jar파일 및 Devpendency를 찾을 수 있다.
http://mvnrepository.com/
밑에 스프링 사이트에서 jar파일 및 Dependency를 찾을수있습니다.
http://www.springsource.com/repository/app/;jsessionid=A431F38984691BE6F71E5849F17C46E0.jvm1
또한 이곳에서도 jar파일 및 Devpendency를 찾을 수 있다.
http://mvnrepository.com/
SpringDM을 사용하여 POJO개발을 하면 BundleActivator로 BundleContext를 받을 수 없다. 하지만 SpringDM이 생성해주는 OSGi Application Context에는 기본적으로 bundleContext라는 Bean이 생성된다. 그러므로 BundleContext가 필요한 클래스에 BundleContextAware 인터페이스를 구현해 주면 BundleContext를 전단 받을 수 있다.
1. BundleContextAware 인터페이스
public interface BundleContextAware{
public void setBundleContext(BundleContext context);
}
2. BundleContext 얻기
public calss 클래스명 implements BundleContextAware{
private BundleContext context;
public void setBundleContext(BundleContext context) {
this.context = context;
}
//위와 같이 BundeContextAware 인터페이스를 구현하면
//SpringDM이 자동으로 setBundleContext를 사용하여 Bean을 주입해줌
ServiceTracker tracker = new ServiceTracker(context, EventAdmin.class.getName(), null);
…
}