Java Client API Prerequisites
Java Client API Prerequisites for NCache ensure the environment is properly set up to take advantage of NCache high-performance distributed caching features. To effectively utilize the features of NCache from your Java applications, specific Maven dependencies have to be added, as well as the necessary namespaces to ensure the API is properly utilized to integrate with the NCache Enterprise distributed data grid.
Important
Ensure that your environment is running a supported Java (JDK) version (11, 17, or 21).
Prerequisites
Before using the NCache Java client-side APIs, ensure that the following prerequisites are fulfilled:
- Add the following Maven dependencies for your Java client application in
pom.xmlfile:
<dependency>
<groupId>com.alachisoft.ncache</groupId>
<!--for NCache Enterprise-->
<artifactId>ncache-client</artifactId>
<version>x.x.x</version>
</dependency>
- Import the following packages in your Java client application:
- The cache must be running.
- Make sure that the data being added is serializable.
- To ensure the operation is fail-safe, it is recommended to handle any potential exceptions within your application, as explained in Handling Failures.
- To handle any unseen exceptions, refer to the Troubleshooting section.
Feature Specific Namespaces
Aside from the namespaces employed in most features, you should add the following namespaces/packages/classes based on the feature/API you intend to use and whether or not they require them.
- For Tags, Named Tags, Locking, and Expirations:
- For Cache Data Dependencies, e.g., KeyDependency, FileDependency, and Database Dependencies: [Deprecated]
- For JSON Data: [Deprecated]
- For SQL Queries:
- For Event Notifications:
- For Continuous Query: [Deprecated]
- For Data Structures:
- For Pub/Sub: