All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tangosol.internal.util.invoke.AbstractRemotable Maven / Gradle / Ivy

There is a newer version: 24.09
Show newest version
/*
 * Copyright (c) 2000, 2022, Oracle and/or its affiliates.
 *
 * Licensed under the Universal Permissive License v 1.0 as shown at
 * https://oss.oracle.com/licenses/upl.
 */
package com.tangosol.internal.util.invoke;


import jakarta.json.bind.annotation.JsonbProperty;

/**
 * Abstract base class for remotable classes.
 *
 * @author as  2015.08.28
 */
public abstract class AbstractRemotable
        implements Remotable
    {
    /**
     * Construct AbstractRemotable instance.
     *
     * @param aCtorArgs  remote constructor arguments
     */
    public AbstractRemotable(Object... aCtorArgs)
        {
        m_aCtorArgs = aCtorArgs;
        }

    // ---- Remotable interface -----------------------------------------

    @Override
    @SuppressWarnings("unchecked")
    public RemoteConstructor getRemoteConstructor()
        {
        RemoteConstructor constructor = m_constructor;
        if (constructor == null)
            {
            constructor = m_constructor =
                    RemotableSupport.get(getClass().getClassLoader())
                            .createRemoteConstructor((Class) getClass(), m_aCtorArgs);
            }
        return constructor;
        }

    @Override
    public void setRemoteConstructor(RemoteConstructor constructor)
        {
        m_constructor = constructor;
        }

    // ---- data members ----------------------------------------------------

    /**
     * Remote constructor to use.
     */
    @JsonbProperty("remoteConstructor")
    private RemoteConstructor m_constructor;

    /**
     * An array of remote constructor arguments.
     */
    @JsonbProperty("remoteConstructor")
    private Object[] m_aCtorArgs;
    }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy