• Facebook
  • Twitter
  • Youtube
  • LinedIn
  • RSS
  • Docs
  • Comparisons
  • Blogs
  • Download
  • Contact Us
Download
Show / Hide Table of Contents

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.xml file:
<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:
    • import com.alachisoft.ncache.client.*;
    • import com.alachisoft.ncache.runtime.*;
    • import com.alachisoft.ncache.runtime.exceptions.*;
  • 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:
    • import com.alachisoft.ncache.runtime.caching.*;
    • import com.alachisoft.ncache.runtime.caching.NamedTagsDictionary.*;
  • For Cache Data Dependencies, e.g., KeyDependency, FileDependency, and Database Dependencies: [Deprecated]
    • import com.alachisoft.ncache.runtime.dependencies.*;
  • For JSON Data: [Deprecated]
    • import com.alachisoft.ncache.runtime.json.*;
  • For SQL Queries:
    • import com.alachisoft.ncache.runtime.caching.*;
  • For Event Notifications:
    • import com.alachisoft.ncache.events.*;
  • For Continuous Query: [Deprecated]
    • import com.alachisoft.ncache.events.*;
  • For Data Structures:
    • import com.alachisoft.ncache.client.datastructures.*;
    • import com.alachisoft.ncache.events.*;
    • import com.alachisoft.ncache.runtime.dependencies.*;
  • For Pub/Sub:
    • import com.alachisoft.ncache.runtime.caching.*;

See Also

Create Cache
Connecting to Cache
Insert Data to Cache

Contact Us

PHONE

+1 214-619-2601   (US)

+44 20 7993 8327   (UK)

 
EMAIL

sales@alachisoft.com

support@alachisoft.com

NCache
  • Edition Comparison
  • NCache Architecture
  • Benchmarks
Download
Pricing
Try Playground

Deployments
  • Cloud (SaaS & Software)
  • On-Premises
  • Kubernetes
  • Docker
Technical Use Cases
  • ASP.NET Sessions
  • ASP.NET Core Sessions
  • Pub/Sub Messaging
  • Real-Time ASP.NET SignalR
  • Internet of Things (IoT)
  • NoSQL Database
  • Stream Processing
  • Microservices
Resources
  • Magazine Articles
  • Third-Party Articles
  • Articles
  • Videos
  • Whitepapers
  • Shows
  • Talks
  • Blogs
  • Docs
Customer Case Studies
  • Testimonials
  • Customers
Support
  • Schedule a Demo
  • Forum (Google Groups)
  • Tips
Company
  • Leadership
  • Partners
  • News
  • Events
  • Careers
Contact Us

  • EnglishChinese (Simplified)FrenchGermanItalianJapaneseKoreanPortugueseSpanish

  • Contact Us
  •  
  • Sitemap
  •  
  • Terms of Use
  •  
  • Privacy Policy
© Copyright Alachisoft 2002 - . All rights reserved. NCache is a registered trademark of Diyatech Corp.
Back to top