HI Davide,

CloudStack has its own module loader and within each component or module, 
classes are instantiated via spring context xml rules. You can refer to:
https://github.com/shapeblue/hackerbook/blob/main/hack/service.md (and other 
chapters)


Regards.

 


________________________________
From: dav...@boccaciccio.it <dav...@boccaciccio.it>
Sent: Thursday, June 27, 2024 13:13
To: dev@cloudstack.apache.org <dev@cloudstack.apache.org>
Subject: Help with spring dependency injection

Hello,
sorry for bothering you with such a silly question,

I am new to spring and I am having a hard time figuring out where the 
initialization of the BaseCmd.java classes 
(src/main/java/org/apache/cloudstack/api/BaseCmd.java) is. I have used java 
with no framework in the past.

If I take this for example:

```
@Inject
public RemoteAccessVpnService _ravService;
```

I get that the actual class is RemoteAccessVpnManagerImpl, but just because it 
is the only class implementing the RemoteAccessVpnService interface. If I 
create a new class implementing said interface, how could I decide which one 
will be instantiated ?

I do not know if this is the right place to ask, if not, I am sorry.

Have a nice day/night
Bye

Reply via email to