Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 884984 Details for
Bug 1086295
SwitchYard injection does not work in @PostConstruct method of Service bean
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
tests
tests.java (text/x-java), 2.69 KB, created by
Anton Giertli
on 2014-04-10 14:54:10 UTC
(
hide
)
Description:
tests
Filename:
MIME Type:
Creator:
Anton Giertli
Created:
2014-04-10 14:54:10 UTC
Size:
2.69 KB
patch
obsolete
>==============1================ >package com.example.switchyard.switchyard_example; > >import javax.annotation.PostConstruct; >import javax.enterprise.context.ApplicationScoped; > >import org.switchyard.component.bean.Property; >import org.switchyard.component.bean.Service; > >//@ApplicationScoped >@Service(GreetingService.class) >public class GreetingServiceBean implements GreetingService { > > @Property(name = "myProperty") > private String myProperty; > > @Override > public String greet(String name) { > System.out.println("myProperty: " + myProperty); > return "Hello " + name + ", myProperty=" + myProperty; > } > >// @PostConstruct >// public void TestMethod() >// { >// System.out.println("+++++++++++++++++++++++++++++++ Display: " + myProperty); >// >// } > >} > > >OUTPUT >16:34:21,695 INFO [stdout] (http-localhost/127.0.0.1:8080-15) myProperty: myValue > > >==============2================ > >package com.example.switchyard.switchyard_example; > >import javax.annotation.PostConstruct; >import javax.enterprise.context.ApplicationScoped; > >import org.switchyard.component.bean.Property; >import org.switchyard.component.bean.Service; > >@ApplicationScoped >@Service(GreetingService.class) >public class GreetingServiceBean implements GreetingService { > > @Property(name = "myProperty") > private String myProperty; > > @Override > public String greet(String name) { > System.out.println("myProperty: " + myProperty); > return "Hello " + name + ", myProperty=" + myProperty; > } > > @PostConstruct > public void TestMethod() > { > System.out.println("+++++++++++++++++++++++++++++++ Display: " + myProperty); > > } > >} > > >OUTPUT > >16:36:26,275 INFO [stdout] (http-localhost/127.0.0.1:8080-29) +++++++++++++++++++++++++++++++ Display: null >16:36:26,276 INFO [stdout] (http-localhost/127.0.0.1:8080-29) myProperty: null > >==============3================ >package com.example.switchyard.switchyard_example; > >import javax.annotation.PostConstruct; > >import org.switchyard.component.bean.Property; >import org.switchyard.component.bean.Service; > >@Service(GreetingService.class) >public class GreetingServiceBean implements GreetingService { > > @Property(name = "myProperty") > private String myProperty; > > @Override > public String greet(String name) { > System.out.println("myProperty: " + myProperty); > return "Hello " + name + ", myProperty=" + myProperty; > } > > @PostConstruct > public void TestMethod() > { > System.out.println("+++++++++++++++++++++++++++++++ Display: " + myProperty); > > } > >} > > >OUTPUT >16:49:35,162 INFO [stdout] (MSC service thread 1-3) +++++++++++++++++++++++++++++++ Display: null >16:49:43,698 INFO [stdout] (http-localhost/127.0.0.1:8080-29) myProperty: myValue
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1086295
:
884983
| 884984