[
https://issues.apache.org/jira/browse/IGNITE-28934?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Nikolay Izhikov reassigned IGNITE-28934:
----------------------------------------
Assignee: Nikolay Izhikov
> Create Message using direct call
> --------------------------------
>
> Key: IGNITE-28934
> URL: https://issues.apache.org/jira/browse/IGNITE-28934
> Project: Ignite
> Issue Type: Task
> Reporter: Nikolay Izhikov
> Assignee: Nikolay Izhikov
> Priority: Major
> Labels: ise
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Currently, Messages instances created using reflection
> {code:java}
> protected <T extends Message> void register(IgniteMessageFactory factory,
> Class<T> cls, short id) {
> Constructor<T> ctor;
> try {
> ctor = cls.getConstructor();
> }
> catch (NoSuchMethodException e) {
> throw new IgniteException("Failed to register message of type " +
> cls.getSimpleName(), e);
> }
> register(factory, cls, id, () -> {
> try {
> return ctor.newInstance();
> }
> catch (Exception e) {
> throw new IgniteException("Failed to create message of type "
> + cls.getSimpleName(), e);
> }
> });
> }
> {code}
> We can generate direct constructor call.
> This will improve performance a bit and made code cleaner.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)