You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by "davide@boccaciccio.it" <da...@boccaciccio.it> on 2024/07/02 06:21:41 UTC
Re: Help with spring dependency injection
Hi Rohit,
Thank you very much,
have a nice day
> On 27 Jun 2024, at 09:45, Rohit Yadav <ro...@shapeblue.com> wrote:
>
> 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: davide@boccaciccio.it <da...@boccaciccio.it>
> Sent: Thursday, June 27, 2024 13:13
> To: dev@cloudstack.apache.org <de...@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